server side search and filtering
server side search and filtering
anilj
Posts: 6Questions: 0Answers: 0
I am using the DataTable() API with a serverSide set to true with an ajax() call. I have a search box that I want use to filter the data on the server side. I am able to submit the request and the server returns back the table (with the specific rows filtered out).
However, my table doesn't get redraw with the data removed/filtered.
I do this to search and redraw the table:
[code]
searchTable.columns( colIdx ).search( fieldvalue ).draw();
[/code]
The server returns a JSON with the filtered data, but the table still shows *all* the data even with the draw.
Should I be using search().draw() or do I need to go through each of the rows and in JS remove the rows using rows().remove()?
Thanks!
However, my table doesn't get redraw with the data removed/filtered.
I do this to search and redraw the table:
[code]
searchTable.columns( colIdx ).search( fieldvalue ).draw();
[/code]
The server returns a JSON with the filtered data, but the table still shows *all* the data even with the draw.
Should I be using search().draw() or do I need to go through each of the rows and in JS remove the rows using rows().remove()?
Thanks!
This discussion has been closed.
Replies
Allan
Today I realized that in addition to searching displayed grid columns our search needs to perform a fulltext search in an enterprise document management system. Somehow I need to merge in results of that search into the datatables search. Or maybe we'll just do our own search.
This also means that search as you type won't be a viable approach. We'll have to add a "Search" button next to the search field, etc.
Any guidance you could offer would be most appreciated.
Thanks Allan for the support!
Allan