Sorting in Each column Not working
Sorting in Each column Not working
Uzairkhan92
Posts: 36Questions: 10Answers: 0
Link to test case:
https://jsfiddle.net/4vnqhwsy/9/
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I want to filter data in each column, right now it's working, but when I am trying to filter volume in the second column so previous column filter gets removed.
Answers
There are a couple main issues with the code:
mainObject
variable doesn't seem to be correct. Its not holding the search values for all the columns. It only keeps the values for the last column.data
parameter elements for all the columns that need to be searched.Take a look at this example from this thread. The idea with this example is it keeps track of the search state for all the checkbox columns. The search plugin loops through all the active checkbox search columns to filter the rows.
Have you looked at SearchBuilder?
Kevin
Can you please fix it for my mainObject?
Its not a simple fix and would take some time. My suggestion is to look at making it an object where the key is the column index and the value is an object containing the search type and value. In the search plugin loop through the object using the key to get the column data for the evaluation. Similar to the checkbox example I linked to.
Kevin