Multiple tables having the same column header order using datatables.net

Multiple tables having the same column header order using datatables.net

shansuratshansurat Posts: 1Questions: 0Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

I have multiple tables that are initialized using the same configuration (colReorder is enabled). What I like to do is enable syncing column headers when the user reorders columns on one table.

What I did is listen to column-reorder on the tables and then reorder programmatically the columns on the other tables. The problem comes up when the same function gets called after the programmatic reordering.

What's the best solution for this problem?

Replies

  • kthorngrenkthorngren Posts: 21,341Questions: 26Answers: 4,954

    The column-reorder event fires when either the user or API reorders the column. I would look at turning off the event handler before reordering via the API then turn it back on once the API is complete.

    Kevin

Sign In or Register to comment.