EasyUI Forum
November 06, 2025, 11:36:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: edatagrid and combogrid as editor  (Read 12240 times)
msvabik
Newbie
*
Posts: 30


View Profile
« 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.
« Last Edit: June 04, 2015, 04:36:47 AM by msvabik » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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.
Logged
msvabik
Newbie
*
Posts: 30


View Profile
« Reply #2 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>
Logged
msvabik
Newbie
*
Posts: 30


View Profile
« Reply #3 on: June 10, 2015, 03:50:05 AM »

No idea?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!