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
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>