How to change this example to a server-side mode?

How to change this example to a server-side mode?

lancwplancwp Posts: 90Questions: 20Answers: 1

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

  • rf1234rf1234 Posts: 2,982Questions: 87Answers: 421

    In this way, the drop-down filter item in the first row only contains the content of the current page,

    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.

  • kthorngrenkthorngren Posts: 21,299Questions: 26Answers: 4,945
    edited June 2022

    Server Side Processing uses the draw parameter as a sequence number. On initialization it sends 1 as the first sequence. In your server script look for the draw parameter and when it is 1 you can build the options and return them in your own object, call it options for example, along with the rest of the JSON response. Use the xhr event to see if the options object exists and if it does populate the search select options.

    Kevin

  • lancwplancwp Posts: 90Questions: 20Answers: 1

    Is there any relevant example, thank you?

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    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

  • lancwplancwp Posts: 90Questions: 20Answers: 1

    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

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓
Sign In or Register to comment.