Replace the search box filter to a combo Box

Replace the search box filter to a combo Box

kibel001kibel001 Posts: 2Questions: 1Answers: 0
edited September 2018 in Free community support

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

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    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

  • kibel001kibel001 Posts: 2Questions: 1Answers: 0
    edited September 2018

    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!!!

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

This discussion has been closed.