How to change this example to a server-side mode?
How to change this example to a server-side mode?
I use http://live.datatables.net/cusologu/7/edit
This example can be filtered normally, but the data volume is too large and the speed is getting slower, so I changed to the server-side method and added
‘’‘
ajax:{
url: '../ php/staff. php',
type: 'POST'
},
serverSide: true,
’‘’
In this way, the drop-down filter item in the first row only contains the content of the current page, and normal filtering can no longer be performed. Where can I modify it? I hope to set an example like this. Thank you very much
This question has an accepted answers - jump to answer
Answers
Yes, that's what serverSide does because for performance reasons you are loading only the values the user sees - and that is the current page.
Server Side Processing uses the
drawparameter as a sequence number. On initialization it sends1as the first sequence. In your server script look for thedrawparameter and when it is1you can build the options and return them in your own object, call itoptionsfor example, along with the rest of the JSON response. Use thexhrevent to see if theoptionsobject exists and if it does populate the search select options.Kevin
Is there any relevant example, thank you?
Not specifically with column filtering, but there is this collection of server side processing examples. Have you got SSP working would be the first step?
Allan
Allan,thank you
Now I don't need all the above column filters, I'm going to use searchbuilder, but it doesn't work either. I wonder if there is an example of searchbuilder under the server
The documentation is here:
https://datatables.net/extensions/searchbuilder/serverside