EasyUI Forum
May 20, 2024, 10:49:00 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: auto select content of propertygrid row  (Read 4530 times)
JeroenNL
Newbie
*
Posts: 37


View Profile
« on: December 31, 2014, 02:09:14 AM »

Hi there,

I've got a propertygrid with several rows containing strings and numbers.

1. When I click on a row, I want the current content automatically selected so that it gets overwritten as soon as I start to type.

2. When pressing TAB inside a row of a propertygrid, I'd like the cursor to be moved to the next editable row.

This functionality will make it very easy for users to interact with a propertygrid. Is this possible with propertygrid?

Cheers,
Jeroen
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 31, 2014, 07:47:58 AM »

Please try to run the code below:
Code:
$('#pg').propertygrid({
onBeginEdit:function(index,row){
var pg = $(this);
var ed = pg.propertygrid('getEditors',index)[0];
var t = $(ed.target).hasClass('textbox-f') ? $(ed.target).textbox('textbox') : $(ed.target);
t.select();
t.bind('keydown',function(e){
if (e.keyCode == 9){
pg.propertygrid('endEdit', index);
if (index < pg.propertygrid('getRows').length-1){
pg.propertygrid('beginEdit', index+1);
return false;
}
}
})
}
})
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!