I have a combo, I want to pass the id to the grid, I find the way to do
my code PHP/HTML:
<?php
include 'conn.php';
$consulta="SELECT cve_prov, nombre_prov FROM tproveedores";
$result= mysql_query ($consulta)
?>
<select name="cboProv" id="cboProveedor" class="easyui-combobox" required="true">
<option value="">Seleccione...</option>
<?php
while ($fila= mysql_fetch_array($result)){
echo "<option value='".$fila['0']."'>".$fila['1']."</option>";
echo $fila['0'];
}
?>
Code Javascript
function agregar(){
// declare variables to bring me the form data
var nombre=$("#nombre_art").val(); //this value has a good time
var precio=$("#precio_art").val(); //this value has a good time
var cboProv=$("#cboProveedor").val(); //this value does not pass
var row = $('#dg').datagrid('getSelected');
if (row){
var index = $('#dg').datagrid('getRowIndex', row);
} else {
index = 0;
}
$('#dg').datagrid('insertRow', {
index: index,
row:{
nombre_art_prov: nombre,
precio_art_prov: precio,
fk_cve_proveedor: cboProv
}
});
$('#dg').datagrid('selectRow',index);
$('#dg').datagrid('beginEdit',index);
}
image of the grid
excuse my English writing, I try to let me know .. thank you
Daniel