search/filter on form, is CONTAINS, how to make it exact match only

Questionssearch/filter on form, is CONTAINS, how to make it exact match only
Paul Hagerty asked 3 years ago

If i use the filter box at the top and type 1 is

i get the results for

1 and
18 and
8718

anything with a 1.. i only want ="1"

can i do that

thank you

1 Answers
Abu Ghufran answered 3 years ago

With that column where you want exact search, you can set:

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

To change this behavior in all search:

Replace cn with eq in code of filterToolbar:
jQuery("#<?php echo $grid_id?>").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false, defaultSearch:'cn'});

Your Answer

1 + 11 =

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 / 5. Vote count:

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

Let us improve this post!