I have a column called arrows. The cell values are up, down, left, right and equal.
Filter one value is no problem.
How can we filter to more than one value, in example: up and left, or up and even?
Thank you!
Using autofilter, You can set "IN" as search operator and use comma to filter multiple values.
You need to set:
$col["searchoptions"]["sopt"] = array("in");
Using search dialog in menu, you can add multiple conditions with OR operator.
$g->set_actions(array(
…..
"search" => "advance",
)
);
I would like to search for a comma separated list too. I tried code below but does not work. What is sopt?
$col = array();
$col["name"] = "names";
$col["title"] = "names";
$col["width"] = "100";
if (editGrid != 'NO'){
$col["editable"] = true;
$col["searchoptions"]["sopt"] = array("in");
}
$cols[] = $col;
I am looking for search to return results for a comma seperated list of values, example: john,tom,mick
Is this possible using the above option and if yes, how to use this? are there any examples?
This should work.
$col = array();
$col["title"] = "Total";
$col["name"] = "total";
$col["width"] = "50";
$col["editable"] = true;
$col["searchoptions"]["sopt"] = array("in");
$cols[] = $col;
To test, paste this code in demos/appearance/alternate-row.php
https://gist.github.com/gridphp/97fdc89b0e8ddb5f30d7
And in autofilter, type "1,120"
It will filter both data records.