Server side search problem with refresh results
Server side search problem with refresh results
I managed to create a search with PHP. PHP provides me the right results. But for me its buggy as hell.
First, lets say i start typing "casino" in search field. I type it slowly. At the last request i got a 3 matches, i see it as a response, its valid JSON. But table stop reacting after first entered symbol. I try with a direct Paste in field. I paste word "Casino" and here we go : i got my 3 matches in table. Everything was fine.
I tried other thing. I pasted "Casino" into search field. Got my 3 records found. Its ok... But when i pasted word "DE" in search field, again, it stopped working, but i see the right data ( my PHP file returned the right data but DataTable doesnt show it ( it was stuck at previous search).
Answers
Without seeing any code it's impossible to answer.
What is the context here? Server-side processing? Why "create a search" when DataTables has built-in search facility?
Sorry, my bad. I`m using built in search of datatables.
Here is the initialization:
Here is the example of search ajax Response. Response is always the right...But as i mention, the search field works only once... When i type "c" and then "a" in search field. I got 2 response. All the responses are totally right, but the table "refuse" to refresh with second response. It refreshes only with first response which is "c", and then only got response from ajax and nothing happens. I tried to paste "casino" into the search field, it worked. I tried to paste "ca" and it works.
bump ?
unless you are going to have a massive amount of data, like @tangerine said, set severSide:false, and send back all the rows and let DataTables do the searching
recordsFiltered doesn't match the amount of data.
I haven't used serverSide myself, so I don't know if that is an issue.
But without a working testcase this is really hard to debug.