Hi,
autocomplete is a good function.
but in the autocomplete.php,
$col["formatoptions"] = array("sql"=>"SELECT client_id as k, name as v FROM clients","search_on"=>"name","update_field" => "client_id");
when we set the edittype of client_id to "select" (as below)
$col["name"]= "client_id";
$col["edittype"]= "select";
the "update_field" (client_id) don't work.
may i have a "callback" function or fix it?
or any suggestion?
Rgds,
The client_id field is hidden field in autocomplete, and it is required for autocomplete function.
If you wish to have dropdown based selection, and fill some value on its behalf, you can refer demos/appearence/dropdown-callback.php in updated build.
Hi,
my demand is:
I assume the database of clients have 10 thousands records.
When I input the data of the invheader , I wish type the customer's name in the cust_name field (virtual column) first,the next field (client_id, cann't be hidden) can according to cust_name to search and return a dropdown menu from clients database.
(Because I cann't download all of the data from clients to make a dropdown menu,it's too large.)
This function look like combine the "dropdown" and "autocomplete".
Rgds,
Hello,
Please explain little more scenario for solution.
Why it is required to have customer name in dropdown. Currently it is in textbox with autocomplete (where as client-id is secretly set for postback operations). Do you want to restrict the customer name to dropdown instead of textbox?
Something like http://harvesthq.github.io/chosen/ ?
so very strange, I changed name of client_id field to another cl_id in database for example. The autocomple.php demos changed client_id to cl_id too. The exam show autocomplete but cl_id field show the name of client not id. When click reload button the record has been changed before disappeared. So please explain this case. Thanks a lot