Default value for multi select search

QuestionsDefault value for multi select search
Cedric asked 6 years ago

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?

3 Answers
Abu Ghufran Staff answered 6 years ago

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

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Cedric replied 6 years ago

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.

Cedric answered 6 years ago

 Is this possible?
Can we have multiple values selected on page load?

Abu Ghufran Staff answered 6 years ago

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)

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

10 + 11 =

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?