I want to autofill a colum but i cant i dunno what´s wrong
$col = array();
$col["title"] = "direccion";
$col["name"] = "direccion";
$col["width"] = "4";
$col["editable"] = true;
$col["align"] = "center";
$col["search"] = true;
$col["formatoptions"] = array( "sql"=>"SELECT direccion as k, nombre as v FROM supervisores","update_field"=>"direccion");
$col["formatoptions"] = array( "sql"=>"SELECT *, nombre as v FROM supervisores",
"search_on"=>"concat(nombre,'-',id)",
"callback"=>"fill_form");
<script>
function fill_form(data)
{
jQuery("input[nombre=direccion].FormElement").val(data.direccion);
jQuery("input[nombre=direccion].editable").val(data.direccion);
}
</script>
When i do the insert (nombre) on grid i want to autofill the direccion field
Hello,
First, this line is redundant, which can be removed.
$col["formatoptions"] = array( "sql"=>"SELECT direccion as k, nombre as v FROM supervisores","update_field"=>"direccion");
Second, the <script> tag should be in <html> code section if not already there.
You can share complete code file for review. You can share at https://gist.github.com/