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