Custom Parameter In Where Clause
Custom Parameter In Where Clause
nicontrols
Posts: 32Questions: 16Answers: 1
Hi, I'm struggling to find out how to pass a custom parameter to the where clause.
So far I have:
editor = new $.fn.dataTable.Editor( {
ajax: {
url: "../../controllers/test.php",
type: "POST",
data: {'custom': 123}
},.....
And in test.php:
Editor::inst( $db, 'table', 'id' )
->fields(
Field::inst( 'field1' ),
Field::inst( 'field2' ),
Field::inst( 'field3' )
)
->where('field1',$_POST['custom'])
->process( $_POST )
->json();
However it returns a JSON error. Is there a way to pass a custom parameter?
This discussion has been closed.
Answers
I was being an idiot.
The ajax data needs to go in the DataTable function, not the Editor: