filter parameter for ajax source

filter parameter for ajax source

crush123crush123 Posts: 417Questions: 126Answers: 18
edited February 2015 in Editor

I realise there must be documentation on this, but I am unable to find it,

The ajax source for my editor / datatables instance loads fine, but it is from a table of about 2500 rows

What i want to do is pass a parameter, eg ID=1 from the datatables instance, so I get only the rows i need

in my ajax source for editor, I can filter my data easily enough by adding a fixed value

$data = Editor::inst( $db, 'tablename' )
->field(
    Field::inst( 'ID' ),
    ...
        )
    ->where('ID', 1)    

but how can i pass a parameter to achieve the same thing ?

Answers

  • crush123crush123 Posts: 417Questions: 126Answers: 18

    FIXED IT !

    Here's one way of doing it...

    On the datatables instance add a get parameter to the ajax url

    on the ajax json source, edit the where condition

    ->where(ID', $_GET['ID'])
    
This discussion has been closed.