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 8 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 8 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

18 + 0 =

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?