EasyUI Forum

General Category => General Discussion => Topic started by: msvabik on June 04, 2015, 04:33:13 AM



Title: edatagrid and combogrid as editor
Post by: msvabik on June 04, 2015, 04:33:13 AM
Hello
I use combogrid as editor field in edatagrid. When you finish editing I want to set additional field values row.
However, the first call onEndEdit the variable r is null. Once I select the same option again, variable r is good.

Code:
        
onEndEdit: function(index,row){
            var ed = $(this).edatagrid('getEditor',{index:index,field:'Kod'});
            var cc = $(ed.target);
            var g = cc.combogrid('grid'); // get datagrid object
            var r = g.datagrid('getSelected'); // get the selected row        
            $.extend(row, {
                Kod: r.Kod,
                Naz: r.Naz
            });
        }

I do not understand why this is happening

thanks for the help.


Title: Re: edatagrid and combogrid as editor
Post by: stworthy on June 04, 2015, 06:02:34 AM
Call 'getSelected' method and then get a null value. This means that no records are selected in the datagrid. Please click the down arrow on the combogrid editor to display the datagrid panel. Check the rows carefully to see if no records are selected.


Title: Re: edatagrid and combogrid as editor
Post by: msvabik on June 08, 2015, 04:39:04 AM
Hi,

I tried and found the row in the datagrid is selected.

definition editor:
Code:
	<th editor="{type:'combogrid',options:{
    idField:'Kod',
    textField:'Kod',
    mode: 'remote',
panelWidth:400,
    url: 'servis.php?com=sklad&action=FastInsert&Web_ID=15',
    onBeforeLoad: function(param) {
    //nactu az budou 4 znaky
    if(undefined === param.q) return false;
    else if(param.q.length > 3) {
    return true;
    } else return false;
},
    columns:[[
              {field:'Kod',title:'Code',width:80},
              {field:'Naz',title:'Name',width:219},
          ]]
}}" data-options="field:'Kod',align:'center',sortable:true">Code</th>


Title: Re: edatagrid and combogrid as editor
Post by: msvabik on June 10, 2015, 03:50:05 AM
No idea?