Multiple drop down column filter doesn't work

QuestionsMultiple drop down column filter doesn't work
Rajeev asked 9 years ago

I have a column called group_id as 1,4 in database..
While showing in grid it will show as aaa,bbb by on_data_display function

while searching in filter as "aaa" it works

filter as bbb it doesn't work.

next value after , doesn't work.

2 Answers
Abu Ghufran answered 9 years ago

You can make dropdown in search autofilter, which shows aaa,bbb etc and search 1-4 values in db.

$col["stype"] = "select";
$col["searchoptions"] = array("value" => ":;1:aaa;2:bbb;3:ccc;4:ddd");
$cols[] = $col;

If you need open text field in search, you can use:

$col["dbname"] = "if(group_id='aaa',1, if(group_id='bbb',2, if(group_id='ccc',3,4)))";

This dbname field is replaced in WHERE clause for specified column search.

Rajeev answered 9 years ago

Thanks for reply, i changed the specified column search to id field and enabled multi select search with "cn" option it works.

Your Answer

0 + 20 =

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?