Editor With WHERE Conditions (not used for saving data)
Editor With WHERE Conditions (not used for saving data)
I want to create some filters for the datatable where I can show only a subset of my data... records with a blank e-mail for example. Based on the server-side php scripts, how can I intercept those POST/GET values and then use them in the SQL so that the records in the editable table are constrained to that subset of my data? I don't want the edits to be based on the where statement, just used to show relative data in the editor in the first place...
This question has an accepted answers - jump to answer
Answers
Use
ajax.data
to send the additional values to the server and then just access them as you would with any other POST / GET parameter (depending on which method you are using).Allan
I can get the data, but I cannot seem to conditionally add a ->Where , or leave the contents blank...
My workaround was to use a test of if ( ! isset($_REQUEST['action'])) and then have a new editor instance and query with the where defined and then a second repeated editor instance without the where... doubles up my code... This way table reads use the where, and table edits don't (since it is only relevant to reads)
Is there a way to conditionally add a WHERE to the editor data source code instead of repeating it (once with for reads and once without for edits)
If I understand correctly, I think you just need to break the chain up:
Have I understood correctly?
Allan
Perfect.
This works... thanks.