EasyUI Forum
December 21, 2025, 07:16:51 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: Commit changes On enter of editable grid textbox  (Read 8367 times)
arma
Full Member
***
Posts: 110


View Profile
« on: June 29, 2014, 08:42:34 PM »

Hi,

I have editable grid with one editable column using textbox for entering integer input.
How could i trigger on enter keypress of the editable textbox column so i could commit and do loop and recalculate the total of amount manually.

Thanks.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 30, 2014, 12:21:15 AM »

Get the editor that bound to a column and you will be able to bind any events on it.
Code:
var dg = $('#dg');
dg.datagrid('beginEdit', index);
var ed = dg.datagrid('getEditor',{index:index,field:...});
$(ed.target).bind('keydown',function(e){
  if (e.keyCode == 13){
    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!