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

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

lancwplancwp Posts: 48Questions: 11Answers: 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

Answers

  • rf1234rf1234 Posts: 2,357Questions: 76Answers: 339

    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: 16,790Questions: 25Answers: 3,979
    edited June 16

    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: 48Questions: 11Answers: 1

    Is there any relevant example, thank you?

  • allanallan Posts: 56,837Questions: 1Answers: 9,034 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: 48Questions: 11Answers: 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,235Questions: 30Answers: 380
Sign In or Register to comment.