Need help on onBeforeFilter event

I am trying to change the behaviour of the header #connector_text_filter. It is working as “LIKE %value%”, but I’d like to use it as “LIKE %value”. I am trying to do this with the onBeforeFilter event, without success.

I found this:

so I am trying to do something like this on server side, but it doesn’t work as I expected:



function custom_filter($filter){
    $index = $filter->index("item_nm");
    if($index == 1){
		$name = $filter->rules[$index]["value"];
		$value = $filter->rules[$index]["value"];
	    $filter->rules[$index] = $name." LIKE '%".$value."'";   
	return true;

Is there any chance to do this, or in worst case I will have to downgrade to an earlier connector, which can be used as:

[code]$gridConnector->event->attach(“beforeFilter”, “manageFilters”);

function manageFilter($col, $mask){
$like = $column." LIKE ‘%“.$mask.”’";
return $like;

Thanks in advance.

Your code looks fine, except of the next lines

if($index == 1){ $name = $filter->rules[$index]["value"];
which must be

[code]if($index !== false){
$name = $filter->rules[$index][“name”];


Thanks a lot, now it is working fine.