Hi Abu. Mix some dropdown and autocomplete on line 202, but it would not be working. Do you have any idea what it might be? The diagnostico field depends on the chosen value in patologia. Thank you
I am unable to understand the issue.
Please send screenshot of expected result. Also send sql dump for testing.
Dear Abu. I send you a summary of the application with a dump of the tables. I tell you that the gen_pathology table has 2434 records and the gen_diagnostic table has 29435. I think that's why I do not use dropdown like dropdown-country-city.php. When I choose a pathology, the diagnostic autocomplete must be armed only with the diagnoses of the chosen pathology
To make second autocomplete dependent on pathology, you just need to set in sql: WHERE codPatologia = '{codPatologia}'
"sql"=>"SELECT codDiagnostico AS k, diagnostico AS v FROM gen_diagnostico WHERE codPatologia = '{codPatologia}' ORDER BY diagnostico"
$col = array();
$col["title"] = "Diagnostico";
$col["name"] = "diagnostico";
$col["editable"] = true;
$col["width"] = "150";
$col["editoptions"] = array("size"=>90, "maxlength" => "90");
$col["formatter"] = "autocomplete"; // autocomplete
$col["formatoptions"] = array("sql"=>"SELECT codDiagnostico AS k, diagnostico AS v FROM gen_diagnostico WHERE codPatologia = '{codPatologia}' ORDER BY diagnostico", "search_on"=>"diagnostico", "update_field"=>"codDiagnostico");
$cols[] = $col;
Working code: https://pastebin.com/5a7BgGDR