Possible to have search/filters away from table
Possible to have search/filters away from table
next2heaven
Posts: 1Questions: 1Answers: 0
I'm wondering if it's possible to have search and filters not that are on the same page but still programmatically connected to the table? (like this: https://www.evernote.com/l/AEhmTUYqoupCAYBN6efAoeavfJpJyl4kx08). If so, how do I go about that?
This discussion has been closed.
Answers
But the filters in your example ARE on the same page! Do you mean you are not using the built in data tables data entry fields for search etc.?
if you mean that I might be able to help you:
A while ago I built something to kind of pre filter a data table on the server side BEFORE it is being sent to the client. (Hadn't discovered server side processing at that time :-)
1. step: saved the search string from the custom built search field into a PHP session variable on the server side.
2. step: used the content of the session variable to set the values in the WHERE clause of the SQL-statement that selects the data for the data table.
That's pretty easy to do I guess.
Here is another example where I used my custom filter on the client side:
1. step: Built a drop down to select date ranges for selection
2. step: Applied that custom filter to my data tables using $.fn.dataTable.ext.search.push
Return "true" means the row is shown, return "false" means the row is hidden.
the two functions I call for completeness
The rather basic HTML