Hello,
Is it possible to have a default value for multiselect search?
$col = array();
$col[“title”] = “Status < “;
$col[“name”] = “etat”;
$col[“width”] = “8”;
$col[“search”] = true;
$str = $g->get_dropdown_values($sqlstatus);
$col[“formatter”] = “select”; // display label, not value
$col[“stype”] = “select-multiple”; // enable dropdown search
$col[‘editoptions’][“size”] = “8”;
$col[“searchoptions”] = array(“value” => “:;”.$str,”defaultValue”=>”6″);
$col[“editoptions”] = array(“value”=>$str);
I tried several options but it does not work.
Anyway to do it?
Please refer demos/search/search-onload.php demo code.
http://www.phpgrid.org/demo/demos/search/search-onload.php
You can also set search value from url:
http://www.phpgrid.org/demo/demos/search/search-onload-url.php?list1_total=total>10
Sorry I misexplained my issue.
I need to put multiple default value in the drop down down select
it works with one values, but not with many.
Yes, If you use multi-selec: e.g.
http://www.phpgrid.org/demo/demos/integrations/multiselect-filter.php?list1_client_id=2,3
You can also have multiple url params:
&list1_<field1>=<value1>&list1_<field2>=<value2>
where list1 is grid id.
To make default selection based from code:
http://www.phpgrid.org/demo/demos/search/search-onload.phps (line 35-46, 92,135)