Sort the datatable using select box with two different hidden columns
Sort the datatable using select box with two different hidden columns

I have select box having two options and I want to sort it by option using values of a hidden column. Suppose if I have three columns two of them are hidden columns, so if I select an option A it must sort by hidden column 2 and if select option B it must sort by hidden column 3. I did a workaround by order([column,’desc’]).draw() it working but column 1 still has default ordering.
This discussion has been closed.
Answers
Without seeing it its hard to say what the problem is. Can you post a link to your page or provide a simple test case replicating the problem?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Assuming the variable
column
inorder([column,’desc’]).draw()
is either 2 or 3 then it should only sort by that column. What do the sorting arrows show?Keep in mind that the column numbers start at 0. So for three columns you have column numbers 0, 1 and 2.
Kevin