Filter expressions

QuestionsFilter expressions
Gary Michael Wilson asked 6 days ago

I have a column that has, for example, values such as “SE”, “SE Technology”, “SE L” and I want to filter down to rows that contain just “SE”. But I get all the above if I filter on “SE” as it is a substring. What syntax do I need to enter to get just “SE” rows? I tried to find some “filter user guide”.


2 Answers
Mike answered 6 days ago

A couple of options.

The default criteria cn (contains). You could modify the default search to be eq (equal), or use the magnifying glass which gives you the option to choose the criteria (contains, equals, does-not equal) in the advanced search.

Each column can have a default setting if you want to configure the search-options. See example below from another post by Abu:

The Demos have some very good examples of more advanced searching with forms as well.



————–8< ————-

(e.g. bw = begins with, ‘eq’,’ne’,’lt’,’le’,’gt’,’ge’,’bw’,’bn’,’in’,’ni’,’ew’,’en’,’cn’,’nc’)

$col[“searchoptions”][“sopt”] = array(“cn”,”bw”); // only show contains and beginswith with first as default.
$cols[] = $col;


Abu Ghufran Staff answered 6 days ago

To limit search with exact match, you can set:

$col["searchoptions"]["sopt"] = array("eq");

Another way is to use dropdown filter. line 64-70

You can also set hardcoded values in search dropdown if don’t want it from db.


$col["searchoptions"] = array("value" => '10:$10;20:$20;30:$30;40:$40;50:$50');

Docs ref:

PS: Thanks Mike.

Abu Ghufran - Dev Team
Grid 4 PHP Framework
Your Answer

12 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?