EasyUI Forum
June 30, 2024, 03:36:29 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: can't move focus to controls in datagrid  (Read 7212 times)
wit_vivek
Newbie
*
Posts: 2


wit_vivek
View Profile Email
« on: February 21, 2013, 08:21:14 PM »

I am using datagrid plugin and when I hit new (new row), I want to move the focus to the first control of the row.
Thanks for your help in Advance.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 23, 2013, 01:29:24 AM »

Are you using edatagrid plugin and calling 'addRow' method to append a new row? If so, get the first editor object and make it get focus after calling the 'addRow' method. The code looks like this:

Code:
var dg = $('#tt');
dg.edatagrid('addRow');
var index = dg.edatagrid('getRows').length-1;  // the editing row index
var ed = dg.edatagrid('getEditors', index)[0];  // get the first editor
$(ed.target).focus();
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!