Replace the search box filter to a combo Box
Replace the search box filter to a combo Box
kibel001
Posts: 2Questions: 1Answers: 0
Please!! somebody can help me..?
Is there a way to Replace the search box filter to a combo Box in the DataTables?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes, you don't have to use or display the default search box. You control this through the
dom
option. You can create any sort of input you want for searching. Here is an example of using select inputs for each column. The example can be adapted to fit your needs.Kevin
I have a combo box already filtering my column, but in the property stateSave:true
when I refresh my website this combo box lose the item selected and take the fist one and the list of item... but the search box by default in datatables keep the data....
I just want the combo box keep the item selected when I press refresh...
Thanks!!! I hope you can help me with more option!!!
Hi @kibel001 ,
That's because the filter is part of DataTables, so it knows the value - your combo box is outside of its knowledge so you have to save those values yourself. This example here is showing how to save the selected rows, you could use this as a basis to save your combo box.
Cheers,
Colin