Serverside Processing - where clause through options?
Serverside Processing - where clause through options?
jandante
Posts: 10Questions: 4Answers: 0
Hi,
I know you can alter the ssp.php file to change your where clause. (I only want a part of the data in my table to be shown).
But is it possible to give this where clause through an option when initializing the DataTable?
This way I can keep using the same ssp.php file for all my tables.
Thanks!
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You could use
ajax.data
to set the additional parameters. Your server-side script would need to be modified to accept the additional data and apply it appropriately.Allan
Ok where as the where clause is build you can there receive the ajax.data info and change the code to be added if not null.
Correct?
Probably if not present (
isset()
in PHP) rather thannull
.Allan
Hi @allan,
for the above question my main concern is that I need all data from a table where client_id = x.
Adding an extra parameter through ajax.data seems a bit hard + it changes my ssp class which I use for my other tables.
Now I've managed to do it like this:
Is this well optimized for the task. Feels like I'm doing a work around.
Thanks for checking this out!
It is a bit of a workaround since the
ajax.data
option is designed as the channel for data communication with the server, just like it is in jQuery. However, it if works - that's great :-)Allan