When using columnControl, is there an event to capture which column(s) are being used for searching?
When using columnControl, is there an event to capture which column(s) are being used for searching?

Link to test case: https://live.datatables.net/xatimufo/7/edit
Description of problem: I can use "api.on('search'
Answers
This shows what is typed in at the top of the screen.
I am trying to find out what filters have been applied for specific columns (e.g. "Name contains 'ra' and Position starts with 'en'").
I have not found an event to hook into. I tried using "api.on('draw')", but it does not seem to have any of the search information.
There isn't an event for that I'm afraid - it isn't something that I'd thought of. What's the use case?
draw
should work - check for.column(x).search.fixed('dtcc')
.Allan
The use case is so that when somebody viewing the table enters a value into multiple "searchDropdown" fields, it's more readily apparent which field(s) are being used for the filter.
For instance, if I enter in "London" for Location and enter in "Eng" for position, there is no "search summary" section which shows what I've entered for filtering.
Using ".column(x).search.fixed('dtcc');" for numeric gives odd results of " function(t){return S(t)!=e}" (where the comparison changes based on the dropdown.
I will look at this again tomorrow.
Yes, the search applied by ColumnControl is a function that is then evaluated by DataTables. There isn't really an API to get the value that is being searched on by ColumnControl. If you just want to determine what column's have a ColumnControl search then the
dtcc
check could be made (truthy).That all said, you could consider using
state()
to get the current state of the table. It does have information about the applied ColumnControl search:Checking that in
draw
might be your best bet for now.Allan
The following is working for me for both the regular searches and for the searchlist. I've added it in to my "on('info')" handler so that it is added as another span after the span where I am doing the "Sorted by" logic.
For the searchlist, the "search.fixed('dtcc')" was not working since it uses "dtcc-list"
Nice one
Allan