EasyUI Forum
May 05, 2024, 08:17:35 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: Issues with propertygrid('beginEdit', i)  (Read 7042 times)
chrwei
Full Member
***
Posts: 219


View Profile Email
« on: October 13, 2014, 01:01:11 PM »

I'm trying to get a "tab to next field" feature working.  I have it working for editor:"text" but for combobox I'm seeing weirdness.  clicking works as expected, but $(x).propertygrid('selectRow', i).propertygrid('beginEdit', i); is making it into a text field instead of the combo.  seems to be a problem with beginEdit.  Should I be doing this differently since it's a propertygrid?

here's what I've got http://cw.archreactor.org/test/test.html
this is actually generated via a template system, which is why there's hidden elements and 2 blocks of javascript.  I've left it in just in case it's causing a problem I'm not aware of.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 13, 2014, 03:33:46 PM »

Please set the 'editor' property for 'value' column in 'onBeforeEdit' event.
Code:
$('#pg').propertygrid({
onBeforeEdit:function(index,row){
var col = $(this).propertygrid('getColumnOption', 'value');
col.editor = row.editor;
},
onBeginEdit:function(index,row){
var pg = $(this);
var ed = pg.propertygrid('getEditor', {index:index,field:'value'});
if (ed){
var input = $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target);
input.focus().on('keydown', function(e){
if (e.keyCode == 9){
pg.propertygrid('endEdit', index);
// SelectNextRow(index);
return false;
}
})
}
}
})
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #2 on: October 13, 2014, 04:10:49 PM »

so beginEdit intentionally doesn't do this automatically?  that seems counter-intuitive, and the docs don't mention it.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: October 13, 2014, 06:45:39 PM »

This issue will be fixed in next version. You can download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #4 on: October 14, 2014, 05:53:10 AM »

thanks  Grin
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!