Error when attempting to sort table columns
Error when attempting to sort table columns
This error occurs on any column that the user attempts to sort.
Error is:
jquery.dataTables.js:6129 Uncaught TypeError: Cannot create property 'length' on number '2'
at _fnSortListener (jquery.dataTables.js:6129)
Oddly in _fnSortListener the sorting variable is set to 2, but then later the code is attempting to set sorting.length = 0 which is where it fails understandably.
Debug:
https://debug.datatables.net/ojigow
Thanks,
Tim
This question has an accepted answers - jump to answer
Answers
Hi Tim,
Thanks for the debug trace. Do you happen to know which table it is that is triggering the error? There are 11 tables on the page.
Thanks,
Allan
Hi Allan,
Yeah sorry should have been more specific. custom-bulkedit is one that is throwing it, but I believe it's any of the *-bulkedit tables
Tim
Hi Tim,
Thanks! I think this is the issue:
The
order
option takes a 2D array, not just a single integer. If you use:that should resolve the issue.
Allan
Thanks Allan. That was it!