How can I optimize the individual column searching ?
How can I optimize the individual column searching ?
correiac
Posts: 2Questions: 1Answers: 0
Hello everyone !
When I search by column using datatables, each character's addition a new request is made. So each of these queries is waiting for the previous one to be complete.
The process is very long, so how can I optimize this ?
Thanks
This discussion has been closed.
Answers
Add a debounce. If you've added code to do the column based search, you can add a javascript debounce to limit how often it is triggered.
Allan
Thanks for your answer !
I'm using DataTables from php code, so for the ajax method which is called when i search in one column i can't really handle it. At least i don't know how...
Have you any idea ? I'm using sg datatables bundle and symfony 2.
I can't really comment on the symfony aspect as I haven't used that framework, but the debounce I suggested and in the post I linked to, is a client-side (i.e. Javascript) function.
Basically you need to put the
column().search()
method inside a debounce function so it isn't called too frequently.Allan