How to change rowReorder.dataSrc attribute dynamically

How to change rowReorder.dataSrc attribute dynamically

Gopi_GGopi_G Posts: 3Questions: 1Answers: 0
edited January 2019 in Free community support

I am using DataTable 1.10.12 , and rowReorder in it. It is working fine but when I apply ordering on any column, It is not working. Please suggest me. How can I achieve it? How can I change rowReorder.dataSrc dynamically?

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    I'm afraid you can't. There is no API for that at the moment.

    Allan

  • Gopi_GGopi_G Posts: 3Questions: 1Answers: 0

    Thanks @allan for quick reply. Please suggest me if there is any other way to achieve it? Because I want rowReorder to be working well after sorting on some column. let me know if there is any way please..

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    RowReorder wasn't designed with that in mind - it assumes that the data to swap is always going to be one specific data point.

    If you want to have the ability to change it dynamically, you'd need to use set this property via a new API method.

    Allan

  • Gopi_GGopi_G Posts: 3Questions: 1Answers: 0

    @allan I have solved the problem by setting orderable:false to that column and applying custom sorting on that column. Now It is working fine. Thanks for Your response.

This discussion has been closed.