EasyUI Forum
September 13, 2025, 10:01:08 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: as passing a data value selected from a combo on: August 05, 2013, 09:34:14 AM
Notice that '#cboProveedor' is a combobox object, you need to call 'getValue' method to get its value.
Code:
var cboProv=$("#cboProveedor").combobox('getValue');

Thank you, I appreciate your attention
2  General Category / EasyUI for jQuery / as passing a data value selected from a combo on: July 26, 2013, 11:46:38 AM
I have a combo, I want to pass the id to the grid, I find the way to do

my code PHP/HTML:

Code:
<?php 
  
include 'conn.php';
 
$consulta="SELECT cve_prov, nombre_prov FROM tproveedores"
 
$resultmysql_query ($consulta)
?>

  <select name="cboProv" id="cboProveedor" class="easyui-combobox" required="true">
    <option value="">Seleccione...</option>
     <?php
         
while ($filamysql_fetch_array($result)){
               echo 
"<option value='".$fila['0']."'>".$fila['1']."</option>";
       echo $fila['0'];
              } 
    
?>


Code Javascript
Code:
   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
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!