Filtering With OR of Multiple Parameters

Hello,
I see in the connector protocol (docs.dhtmlx.com/doku.php?id=dhtm … ol_details) that I can provide fields to filter the data on. However, it seems that if multiple fields are provided the AND operator is used on them. Is there a way to use the OR operator?

index.html

projects.load("./data/projects.php?connector=true&dhx_filter[fk_owner]="+cookieUserId+"&dhx_filter[fk_delegate1]="+cookieUserId);

projects.php log output

SELECT  projects.id,projects.code,projects.description,
				owner.initials as new_owner,
				delegate1.initials as new_delegate1,
				delegate2.initials as new_delegate2,
				delegate3.initials as new_delegate3 FROM projects 
             		LEFT JOIN people as owner ON projects.fk_owner=owner.id
             		LEFT JOIN people as delegate1 ON projects.fk_delegate1=delegate1.id
             		LEFT JOIN people as delegate2 ON projects.fk_delegate2=delegate2.id
             		LEFT JOIN people as delegate3 ON projects.fk_delegate3=delegate3.id WHERE `fk_owner` LIKE '%2%' AND `fk_delegate1` LIKE '%2%'

Thank you,
Eric

There is no such possibility for default connector.
But you can use server side event handler to customize behavior, you can define beforeFilter handler from which you can add your own filtering sql, using parameters from the url

It is not as flexible as default AND logic, because you will need to predefine set of fields, and use them in all requests.

If necessary I can provide a sample.

Hello Stanislav,
Thank you for offering to help. I followed your direction and created a custom filter. I used the example found in the connector filtering documentation (docs.dhtmlx.com/doku.php?id=dhtm … :filtering) and created a simple custom filter in my PHP file. It seems to work fine.

$gridConn->event->attach("beforeFilter","myFilter");

function myFilter($filter_by){
          if (!sizeof($filter_by->rules)) 
              	$filter_by->add("fk_who","value","LIKE");
         //change WHERE some_field LIKE '%value%' to the WHERE some_field > 'value'
          $index = $filter_by->index("fk_who");
          if ($index!==false)  //there is client side input for the filter
               $filter_by->rules[$index]["operation"]="=";
}

Cheers,
Eric

Hi, there is any example? of how to use OR instead of default AND with the filtering of multiple parameters.

Regards,
Oscar

Unfortunately there is no ready to use example.