开发者

ExtJS add hotkey

开发者 https://www.devze.com 2023-03-30 05:44 出处:网络
I want to add hotkey func开发者_如何学Gotionality to my page. Ext.onReady(function () { Ext.util.KeyMap(document, {

I want to add hotkey func开发者_如何学Gotionality to my page.

Ext.onReady(function () {
    Ext.util.KeyMap(document, {
        key: 'abc',
        handler: function () {
            alert("Hotkey was pressed!");
        }
    });
});

But the event doesn't occurs.


Ext 3.3.1 :

Ext.onReady(function () {
    new Ext.KeyMap(document, {
        key: 'abc',
        fn: function () {
            alert("Hotkey was pressed!");
        }
    });
});

in Ext 4.0.2.a :

Ext.onReady(function () {
    var map = new Ext.util.KeyMap(document,{
            //key : "abc" //doesn't work (mybe a bug)
            key: [65,66,67], // this works,
            fn: function(){ alert('a, b or c was pressed'); }
        }
    );
});


Use fn key, not handler in params

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号