Changing server side params
Changing server side params
d0mokun
Posts: 12Questions: 4Answers: 0
Hello all,
Are there any examples of how to manipulate SSP params as per https://datatables.net/manual/server-side ?
I am trying to use regex with SSP for searching and I don't understand the above page entirely.
Thanks
Dan.
This discussion has been closed.
Answers
It's just an idea transform the request to POST method instead of GET and then stringify it then make appropriate changes.
var table = $('#company').DataTable( {
dom: "Bflrtip",
responsive: true,
colReorder: true,
stateSave: true,
"deferRender": true,
"processing": true,
"serverSide": true,
"ajax": {
"url": "/api/management/customer/listing2",
"dataType": "json",
"type": "POST",
contentType: 'application/json',
data: function ( data ) {
return JSON.stringify( data );
}
then parse the body on the server side :)
Thing is I've already got quite a complex setup for rendering the table and body. Literally the only thing giving issues is regex searching / filtering, which is just escaping me!
Thanks
Ok disregard what i've previously said, because I thought that you just want to change the params. hheheehe
I managed to fix this one myself!
I adjusted the AJAX code to send extra parameters to my SSP php file. I then rewrote the php file to allow for conditions using the complex ssp method if a value was sent, or simple if not.
'cust_id' being the condition value used to shape a search.
Thanks
Dan.