Custom WHERE statement in server-side processing example
Custom WHERE statement in server-side processing example
stevevance
Posts: 58Questions: 6Answers: 1
I recently switched to using server-side processing because I had thousands of rows to display (and has improved by site's usability). Now I no longer want to display the entire table's data, but a subset of that data using a custom WHERE statement.
I cannot see in your SSP example (I'm using DataTables v1.10) a good place to add a custom WHERE statement.
The site is http://licensedchicagocontractors.com. The default tab view shows all construction activity. I would like to show a second tab view that shows all construction activity that's labeled in the database as "new construction."
I cannot see in your SSP example (I'm using DataTables v1.10) a good place to add a custom WHERE statement.
The site is http://licensedchicagocontractors.com. The default tab view shows all construction activity. I would like to show a second tab view that shows all construction activity that's labeled in the database as "new construction."
This discussion has been closed.
Replies
There should probably be a callback added at this point: https://github.com/DataTables/DataTablesSrc/blob/master/examples/server_side/scripts/ssp.class.php#L216 which can be used to add additional WHERE statements. Perhaps the callback should return an associative array which could be used and bound as parameters - otherwise you need to mess around with the `bind` static function... What do you think - would that meet your requirements?
I should point out as well that the script is meant to just be a demo case which can be customised. Although it probably should cope this by default.
Allan
It worked perfectly for my needs at the beginning. I want to introduce new sorting/grouping features to the website.
I didn't find the [code]bind[/code] static function in the http://next.datatables.net documentation.
i have the same problem, im using the ssp.class.php and i cant figure out how to retrive records using the where clause, for example i have a table named cars and i want to retrive only those cars that belongs to ford for example; ford is part of another table name manufacturers