Select dropdown filter first option not working

QuestionsSelect dropdown filter first option not working
Michael Olson asked 2 years ago

I have the following set for a select filter but the first option doesn’t bring back any results. I have other filter dropdowns set the same way and none of them work with the first option.

 

//TYPE
$col = array();
$col[“title”] = “Type”; // caption of column, can use HTML tags too
$col[“name”] = “type”; // grid column name, same as db field or alias from sql
$col[“editable”] = true;
array(“list”=>true, “add”=>true, “edit”=>true, “view”=>true, “bulkedit”=>false);
$col[“edittype”] = “select”;
$col[“editoptions”] = array(“value”=>’Bus:Bus;Small Bus:Small Bus;Van:Van’);
$col[“stype”] = “select”;
$col[“searchoptions”] = array(“value”=>’Bus:Bus;Small Bus:Small Bus;Van:Van’, “separator” => “:”, “delimiter” => “;”);
$cols[] = $col;

2 Answers
Michael Olson answered 2 years ago

It seems that if I add a blank selection at the beginning that works. Not sure if this is the answer but here is the search options that worked for me:

 

$col[“searchoptions”] = array(“value”=>’:;Bus:Bus;Small Bus:Small Bus;Van:Van’, “separator” => “:”, “delimiter” => “;”);

Abu Ghufran Staff answered 2 years ago

Yes, that’s necessary in search options to allow no-selection while filtering.

PS: Please let me know about the export issue in email / chat / ticket.

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

4 + 7 =

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?