ColumnControl: issue with state and reorder

ColumnControl: issue with state and reorder

timb72timb72 Posts: 17Questions: 4Answers: 0

I need to spend some time putting a test together, but I think there is a potential bug with the state object and ColumnControl.

I'm passing the following $('#table').DataTable().state() as an argument called state to a function that manipulates the data before an ajax call (via preXhr)

For each item of the state.columnControl object there is either a searchInput or searchList with their respective properties and all works fine on initial render.

However, I have 'reorder' set on each column of my table, and when I drag a column to a new position and then do another ajax call (triggered by using any ColumnControl search) it seems that the state.ColumnControl object does not respect the changed column position and gets confused?

Say that the column I want to reorder is a searchList, and I move it to a column position currently held by a column that is a searchInput - it seems to "combine" the searchList with the searchInput or the new column position, and the index of the column that it was moved from disappears?

I know the above may sound a bit garbled, but just wondered if anyone has experienced similar with the state object and ColumnControl!?

Tim

Answers

  • allanallan Posts: 64,829Questions: 1Answers: 10,731 Site admin

    Hi Tim,

    Column reordering certainly adds extra complexity to the state handling, so it is possible I've missed something. I wasn't aware of any issues, but I might just have not encountered them yet. If you are able to provide a test case showing the issue, that would be really useful.

    Thanks,
    Allan

Sign In or Register to comment.