Better search inside dropdown contain and on mobile phones

QuestionsBetter search inside dropdown contain and on mobile phones
Nicolas asked 4 weeks ago

Hi, I would like to know if it would be possible to search in a dropdown in an extensive way: I mean, now if you type some letters it will look the first occurence of this combination but if will not look inside the row contain. Also on a mobile phone there the keyboard doesn\’t open to search, so the only option is to go down the list, but in my case I have about 1.000 clients, so it\’s too slow to search and find. the best way would be to be able to search inside the list typing any part of text and that would apply also to mobile phone. Thank you

1 Answers
Abu Ghufran Staff answered 4 weeks ago

Hello,

Instead of dropdown, you can use lookup edittype which allow searching.

$col = array();
$col[“title”] = “Company Name”;
$col[“name”] = “company_name”;
$col[“width”] = “50”;
$col[“editable”] = true;
$col[“edittype”] = “lookup”;
$col[“editoptions”] = array(“table”=>”suppliers”, “id”=>”company_name”, “label”=>”company_name”);
$cols[] = $col;

You can specify sql as well:

$col[“edittype”] = “lookup”;
$col[“editoptions”][“sql”] = “SELECT category_name as k, category_name as v FROM categories”;

You will also need select2 resource files included.

<link href=”//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css” rel=”stylesheet” />
<script src=”//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js”></script>

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

1 + 3 =

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?