EasyUI Forum
September 14, 2025, 12:51:13 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid-cellediting : endEdit on blur  (Read 9861 times)
korenanzo
Guest
« on: May 12, 2016, 08:57:09 AM »

Hi all,

when I'm editing a cell,I can finish the editing  clicking on another cell or pressing ENTER or tab.
And that's OK.

BUT
I'd like finishing the edit  every time I lose the focus from my cell, for example clicking on a textfield or even clicking OUT of the browser.

I've binded  a function on thetextbox' blur event:
Code:
	onCellEdit: function (_index, _field) {
var dg = $(this);
var index = _index;
var field = _field;
var input = dg.datagrid('input', {
index: index,
field: field
});
  ...
input.bind('blur', function (e) {
  dg.datagrid('endEdit', index);
  });

                       ....

but it doesn't work:
it goes in a loop and throws a

 Maximum call stack size exceeded
error

any suggestion?

Thanks,

RIc
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: May 12, 2016, 05:44:43 PM »

Please bind the 'focusout' event instead, or download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.5-patch.zip.
Code:
input.bind('focusout', function (e) {
dg.datagrid('endEdit', index);
});
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!