Individual column searching (select inputs)

Individual column searching (select inputs)

DeNoiRDeNoiR 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.

Answers

  • denis.khucdenis.khuc Posts: 4Questions: 2Answers: 0

    Hi I have same problem.

    Did you find a solution?

  • jr42.gordonjr42.gordon Posts: 305Questions: 2Answers: 49

    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.

  • denis.khucdenis.khuc Posts: 4Questions: 2Answers: 0

    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.

  • jr42.gordonjr42.gordon Posts: 305Questions: 2Answers: 49
This discussion has been closed.