Hello, I know custom filter for just 1 column from this forum.
function custom_filter($filter_by){
$index = $filter_by->index("name");
if ($index!==false) {
$value = $filter_by->rules[$index]["value"];
// any sql code here
$filter_by->rules[$index]="name LIKE $value";
}
}
$grid->event->attach("beforeFilter", "custom_filter");
$grid->render_table("employee","id","name,address");
How about 2 columns ?
First I want know if user filtering using 1 column or 2 columns & then make LOWER CASE(value) for that column(s) in WHERE statement
Pseudo Code
if (one field ) {
WHERE LOWER(field1) LIKE LOWER(value);
}
if (more than one field ) {
WHERE LOWER(field1) LIKE LOWER(value) AND LOWER(field2) LIKE LOWER(value2);
}
Thanks