Updating the select2 dropdown list along with search results
Updating the select2 dropdown list along with search results
For one of my reports, I am using select2 inline filter along with the usual string and dropdown filter available here
https://datatables.net/extensions/fixedheader/examples/options/columnFiltering.html
Select2 dropdown lists all the available unique values of the particular column. I am looking for an option to update this dropdown list outside the initComplete() method so that whenever the table is filtered with other search conditions the select2 dropdown list is also updated with filtered rows.
Answers
The best place would be in
search
- that's called whenever a search is applied to the table. Another possible option would bedraw
, but that would also be called if the ordering is changed,Colin
See if Allan's example in this thread helps.
Kevin