Escape character when using connector text filter

Hi,

I would like to modify the default filtering condition to use an escape character. Using php connector with a pdo database connection. On looking at the logs the filtering is

I would like this to be

Im sure it can be done using the beforeFilter event … but I cant figure out from the docs.

Thanks,

Dave

Yep, beforeFilter is a bit cryptic

function custom_filter($filter_by){
       $index = $filter_by->index("PARM_NAM");
       if ($index!==false)  //there is client side input for the filter
             $filter_by->rules[$index]["value"]= some_custom_processing($filter_by->rules[$index]["value"]);
}
$conn->event->attach("beforeFilter","custom_filter");

Thanks Stanislav,
This allows me to change the value in the filter …

but I need to add " escape ‘/’ " to the end of the sql thats executed in the filter operation … I cant see how to do that using this method.

Dave

Sorry, I didn’t get it from the original question
You can use the similar code

function custom_filter($filter_by){
$index = $filter_by->index(“PARM_NAM”);
if ($index!==false) { //there is client side input for the filter
$value = $filter_by->rules[$index][“value”];
$name = $filter_by->rules[$index][“name”];
$filter_by->rules[$index] = " $name LIKE ‘$value’ escape ‘’ ";
}
}
$conn->event->attach(“beforeFilter”,“custom_filter”);

Which will set custom sql code for the filter in question

Not sure will it work for you or not, as you need the similar code added after LIMIT in the first query. If you good with PHP - you can subclass MySQLDBDataWrapper and override query method with logic to add extra code for each sql query ( and use your new DB type name as parameter of scheduler to use you custom db class instead of the original one )

Stanislav,

Dont actually need the escape after the limit 0,100 so this code works for me and allows me to filter for underscores

Thanks,

Dave

Generated SQL is