Hi all, i'm having am issue with autocomplete i need to search for a client_name and get the value of the VAT and store the two, what is happening is that is doing everithing just dont store the value of client. he search and fill both but just store the VAT.
Here is my code:
Thank you all
$col = array();
$col["title"] = "Client"; // caption of column
$col["name"] = "client"; // grid column name, same as db field or alias from sql
$col["editable"] = true;
$col["width"] = "150";
$col["formatter"] = "autocomplete"; // autocomplete
$col["formatoptions"] = array("sql"=>"select name as v, vat as k From CLIENTS","search_on"=>"name", "update_field" => "VAT");
$col["editrules"] = array("required"=>true, "readonly"=>false);
$cols[] = $col;
$col = array();
$col["title"] = "VAT"; // caption of column
$col["name"] = "VAT"; // grid column name, same as db field or alias from sql
$col["editable"] = true;
$cols[] = $col;
I am unable to generate this behavior. Your code also looks fine.
Working demo here:
http://hastebin.com/ebimeqopay.php
Change client name, it will change name and gender.