Custom WHERE statement in server-side processing example

Custom WHERE statement in server-side processing example

stevevancestevevance Posts: 58Questions: 6Answers: 1
edited March 2014 in General
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."

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi,

    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
  • stevevancestevevance Posts: 58Questions: 6Answers: 1
    "I should point out as well that the script is meant to just be a demo case which can be customized."

    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.
  • patopatopatopatopatopato Posts: 4Questions: 1Answers: 0

    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

This discussion has been closed.