EasyUI Forum

General Category => Bug Report => Topic started by: sean on September 23, 2014, 11:36:28 PM



Title: How to Get the value of the numberbox before losing focus?
Post by: sean on September 23, 2014, 11:36:28 PM
Edatagrid Control
Press the DOWN arrow key to edit the next line,Numberbox values have not been saved when the cursor in numberbox.

MAY BE unable to get numberbox value before save row


Title: Re: How to Get the value of the numberbox before losing focus?
Post by: stworthy on September 23, 2014, 11:40:05 PM
Please show an example or a page link to demonstrate your issue.


Title: Re: How to Get the value of the numberbox before losing focus?
Post by: sean on September 24, 2014, 01:09:47 AM
Double click - edit;
Enter key - edit next cell;
Down arrow key - edit next row;

please edit cell value and press enter or down arrow key to edit next row, The numberbox at the cursor have not been saved


Title: Re: How to Get the value of the numberbox before losing focus?
Post by: stworthy on September 24, 2014, 03:41:14 AM
Please add the 'onEndEdit' event handler for your datagrid.
Code:
$('#dtg_test').edatagrid({
onEndEdit:function(index,row){
var editors = $(this).edatagrid('getEditors',index);
for(var i=0; i<editors.length; i++){
var ed = editors[i];
var t = $(ed.target);
if (t.hasClass('textbox-f')){
t.textbox('textbox').trigger('blur')
row[ed.field] = t.textbox('getValue');
}
}
}
});