Individual column searching (select inputs)
Individual column searching (select inputs)
DeNoiR
Posts: 1Questions: 1Answers: 0
I'm referring to the example here: http://www.datatables.net/examples/api/multi_filter_select.html
Is there a way to update the select inputs so that they only show the available options after filtering?
If one chooses Tokyo under the Office column, the other selects still show all options from the unfiltered table but only 4 of them apply to people from the Tokyo office. I would like to display only the options that exist after filtering for Tokyo.
This discussion has been closed.
Answers
Hi I have same problem.
Did you find a solution?
In the example you linked, the selects are created using simple JavaScript and appended to the table footer. The only thing utilizing DataTables is the actual column.search() inside the onchange event. So I don't believe DataTables inherently has a solution for you.
The only solution I can think of would be to "disable/grey out" select options that don't apply in the associated column after the change event. This will be done to all other columns selects and not to the column select that fired the change event.
I would like to get the different values in column after filtering which api should I use ?
I tried column.data() but it return all values from the table.
You have to add https://datatables.net/reference/type/selector-modifier to column.
check out http://yadcf-showcase.appspot.com/cumulative_filtering.html