How can we enable "cn" in multiselect search feature ?

QuestionsHow can we enable "cn" in multiselect search feature ?
Hemant Mahale asked 2 years ago

Hello Abu,

Here, We need to enable “cn” in multi-select search.

my code:

$str = ”;//db query
$col[“editable”] = false;
$col[“search”] = true;
$col[“stype”] = “select-multiple”; // enable dropdown multiple search
$col[“searchoptions”] = array(“value” => $str);
$col[“searchoptions”][“sopt”] = array(“cn”);//default phpgrid search is “op”:”in”
i tried with “sopt” but still it is searching with “in”.

why ?

2 Answers
Abu Ghufran Staff answered 2 years ago

Multiselect expected exact values to be searched but could be multiple. Thats why we have used IN operator here.

Can you explain use case where you need contains with multi-select options?

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Hemant Mahale answered 2 years ago

multi-select is working in our dropdown field type which contains only one value at a time.

e.g., city = ‘Mumbai’; // IN is working for it

but

here, we are using multi-select for multi-checkbox field type which contains a comma separated values

e.g., education = “BCA,MCA,PhD”; // IN is not working for it so we need to enable “cn” op

I hope from this example you can understand it better

Your Answer

18 + 1 =

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?