colReorder error with variable columns table

colReorder error with variable columns table

craighcraigh Posts: 9Questions: 3Answers: 0

I have a datatable that uses colReorder but via server-side code allows the user to change the included columns. As you would expect, if the columns have been reordered and then the number of columns changes, an errors occurs "DataTables warning: table id=board-member-report-table - ColReorder - column count mismatch".

I am looking for a way to hook into the instantiation of the datatable to check for this mismatch. If the current column count is not equal to the saved state of the colReorder count then I'd simply like to reset the colReorder to 'normal'.

I looked for a dt event or state event, but cannot find the correct one (or maybe there isn't one). Can you tell me if there is such an event, or if there is a way to better handle this?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,918Questions: 1Answers: 10,751 Site admin
    Answer ✓

    What version are you using? The latest versions shouldn't have such a problem. This is the line that checks.

    If updating doesn't solve it (or you are already at the latest version), please link to a test case showing the issue.

    Allan

  • craighcraigh Posts: 9Questions: 3Answers: 0
    edited August 18

    I currently have dt v2.2.1 and colReorder 2.0.4. I'll try an upgrade.

  • craighcraigh Posts: 9Questions: 3Answers: 0

    Indeed, upgrade seems to have solved it B) Thank you! :)

Sign In or Register to comment.