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

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

lancwplancwp Posts: 85Questions: 18Answers: 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,801Questions: 85Answers: 406

    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: 20,141Questions: 26Answers: 4,736
    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: 85Questions: 18Answers: 1

    Is there any relevant example, thank you?

  • allanallan Posts: 61,439Questions: 1Answers: 10,052 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: 85Questions: 18Answers: 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,342Questions: 35Answers: 394
    Answer ✓
Sign In or Register to comment.