EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: chkaufmann on February 24, 2014, 06:38:42 AM



Title: Propertygrid keyboard support
Post by: chkaufmann on February 24, 2014, 06:38:42 AM
I would like to bind the keydown event for all editors. But I don't find out when/where. In onBeforeEdit the editor doesn't exist yet.

The behaviour should be:
- <F2> calls "beginEdit"
- <enter> calls "endEdit"
- <esc> calls "cancelEdit"

And finally if I click on a combo with editable=false, I would like to force a showPanel without a second click.

cu Christian


Title: Re: Propertygrid keyboard support
Post by: stworthy on February 25, 2014, 01:12:14 AM
Please try the code below to get the editor in 'onBeforeEdit' event.
Code:
$('#pg').propertygrid({
    onBeforeEdit:function(index,row){
    var t = $(this);
    setTimeout(function(){
    var ed = t.propertygrid('getEditor', {
    index: index,
    field: 'value'
    });
    console.log(ed)
    },0);
    }
})