Is there the equivalent of a 'Where' clause

Is there the equivalent of a 'Where' clause

pzh20pzh20 Posts: 66Questions: 15Answers: 0

If i need to filter the data at source, can this be done and how?

Regards
Pete

This question has an accepted answers - jump to answer

Answers

  • crush123crush123 Posts: 417Questions: 126Answers: 18
    edited March 2015 Answer ✓

    when you create the json source for editor you can add the where clause

    eg

    Editor::inst( $db, 'browsers' )
         ->fields(
             Field::inst( 'first_name' )->validator( 'Validate::required' ),
             Field::inst( 'last_name' )->validator( 'Validate::required' ),
             Field::inst( 'country' ),
             Field::inst( 'details' )
         )
         ->where('last_name', 'Smith');
         ->process( $_POST )
         ->json();
    

    http://editor.datatables.net/docs/1.4.0/php/class-DataTables.Editor.html

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    Great, this is better than I thought.

    Many thanks

This discussion has been closed.