Title: on focus combobox autoopen
Post by: ppp on February 06, 2015, 11:59:15 PM
Hi, I have de following edatagrid $('#dgAcctManual').edatagrid({ url:"acctmov/acctmovmanual_retrieve.php", updateUrl: 'acctmov/acctmovmanual_update.php?typeUpdate=update', pageSize:15, rownumbers: false, pagination: true, toolbar: '#tbAcctMovManual', sortname: 'id', sortorder: 'asc', fitColumns:true, autoSave: false, remoteFilter: true, showFooter:true, pageList:[15], singleSelect:true, columns: [[ {field:'id' ,title:'N.' , sortable:true, width: 10}, {field:'acctidname' ,title:'Cuenta' , editor:{ type:'combobox' , options:{valueField:'id', textField:'name1',url:'acctmov/get_utils.php?type=acct2&filter=3',selectOnNavigation:true,editable: true, required: false, width:300, panelWidth:300 } },sortable:true, width: 200}, {field:'stationname' ,title:'RBase' , editor:{ type:'combobox' , options:{valueField:'id', textField:'name',url:'acctmov/get_utils.php?type=stations&filter=2',selectOnNavigation:true,editable: false, required: false, width:300, panelWidth:300 } },sortable:true, width: 20}, {field:'providername' ,title:'Prov.' , editor:{ type:'combobox' , options:{valueField:'id', textField:'name',url:'acctmov/get_utils.php?type=provider&filter=2',selectOnNavigation:true,editable: false, required: false, width:300, panelWidth:300 } },sortable:true, width: 20}, {field:'employeename' ,title:'Emp.' , editor:{ type:'combobox' , options:{valueField:'id', textField:'name',url:'acctmov/get_utils.php?type=employee&filter=2',selectOnNavigation:false,editable: false, required: false, width:300, panelWidth:300 } },sortable:true, width: 20}, {field:'var1name' ,title:'Reg.' , editor:{ type:'combobox' , options:{valueField:'id', textField:'name',url:'acctmov/get_utils.php?type=var1&filter=2',selectOnNavigation:false,editable: false, required: false, width:300, panelWidth:300 } }, sortable:true, width: 30}, {field:'var2name' ,title:'CNeg.' , editor:{ type:'combobox' , options:{valueField:'id', textField:'name',url:'acctmov/get_utils.php?type=var2&filter=2',selectOnNavigation:false,editable: false, required: false, width:300, panelWidth:300 } }, sortable:true, width: 30}, {field:'var3name' ,title:'Serv.' , editor:{ type:'combobox' , options:{valueField:'id', textField:'name',url:'acctmov/get_utils.php?type=var3&filter=2',selectOnNavigation:false,editable: false, required: false, width:300, panelWidth:300 } }, sortable:true, width: 30}, {field:'amountd' ,title:'Debe' , editor:{ type:'numberbox' , options:{min:0,max:999999999, precision: 2, required: false } },styler:cSAcctType1,sortable:true, width: 30,align:'right'}, {field:'amounth' ,title:'Haber' , editor:{ type:'numberbox' , options:{min:0,max:999999999, precision: 2, required: false } },styler:cSAcctType1,sortable:true, width: 30,align:'right'} ]], onError: function(index,row){ $.messager.alert("ERROR" , row.msg,'error'); $('#dgAcctManual').edatagrid('cancelRow', index); }, onBeforeEdit:function(index,row){ row.editing = true; updateActionsAcctMovManual(index); }, onAfterEdit:function(index,row){ alert('aca'); row.editing = false; updateActionsAcctMovManual(index); }, onBeforeSave:function(index,row){ $('#dgAcctManual').datagrid('endEdit', index); $('#dgAcctManual').datagrid('reload'); row.editing = true; }, onCancelEdit:function(index,row){ row.editing = false; updateActionsAcctMovManual(index); } });
What I need is that after select first column value and press key ... the next column (stationname) gets automatically open to select the option... It this possible? Kind Regards
Title: Re: on focus combobox autoopen
Post by: stworthy on February 07, 2015, 08:21:17 AM
When begin editing a row, you can get all the editors and bind any events on them. $('#dg').edatagrid({ onBeginEdit: function(index,row){ var editors = $(this).datagrid('getEditors', index); $.each(editors, function(i, ed){ var tb = $(ed.target).hasClass('textbox-f') ? $(ed.target).textbox('textbox') : $(ed.target); tb.bind('keydown', function(e){ //... }); }) } });
|