Programmatic manipulation of the search box?
Programmatic manipulation of the search box?
iain_mc
Posts: 15Questions: 0Answers: 0
Hullo,
So I'd like to click on a field in the dataTable and have the table filter by that keyword.
Easy to do with a call to fnFilter, but then I have to have another button the user has to click to clear the filter, plus there is no visible indication the table is in a filtered state.
What I'd like to do is take the content of the field, put it into the dataTables search box so that (a) there's a visible cue to the filter, and (b) the user could delete it there to restore the table to its unfiltered state.
Is this possible?
Thanks!
Iain
So I'd like to click on a field in the dataTable and have the table filter by that keyword.
Easy to do with a call to fnFilter, but then I have to have another button the user has to click to clear the filter, plus there is no visible indication the table is in a filtered state.
What I'd like to do is take the content of the field, put it into the dataTables search box so that (a) there's a visible cue to the filter, and (b) the user could delete it there to restore the table to its unfiltered state.
Is this possible?
Thanks!
Iain
This discussion has been closed.
Replies
DataTables should update the global search input when you do a global search via the fnFilter method (although there is an option to disable that action). I've put an example together here: http://live.datatables.net/oluver/edit#javascript,html
Allan
I was using the specific column filter option in fnFilter, hadn't thought of trying the global.
Cheers, Iain
Allan