beforeFilter
The event occurs before data loading and allows to customize filtering of dataset.
$conn->event->attach("beforeFilter",handlerFunc);
Parameters handlerFunc:
- $filter_by - FilterInterface object
Availability:
- Available for Grid, Combo
Sample:
function custom_filter($filter_by){ if (!sizeof($filter_by->rules)) $filter_by->add("some_field","value","LIKE"); //change WHERE some_field LIKE '%value%' to the WHERE some_field > 'value' $index = $filter_by->index("some_field"); if ($index!==false) //there is client side input for the filter $filter_by->rules[$index]["operation"]=">"; } $conn->event->attach("beforeFilter","custom_filter");