你好我想要Ext.panel.Panel键盘上点击按钮的输入功能,我这样做: 延伸:' Ext.window.Window'
Ext.define('Container', {
extend: 'Ext.window.Window',
alias : 'widget.container',
title : 'book',
listeners: {
afterrender: function (thisForm, options) {
this.keyMap = Ext.create(
'Ext.util.KeyMap',
this.el,
[
{
key: 13,
fn: function () {
Ext.Msg.alert('title', 'you click enter');
},
scope: this
}
]
);
}
},
但是当我在 Ext.panel.Panel 上执行此操作时,它无效:
Ext.define('doc', {
extend: 'Ext.panel.Panel',
alias: 'widget.doc',
listeners: {
afterrender: function (thisForm, options) {
this.keyMap = Ext.create(
'Ext.util.KeyMap',
this.el,
[
{
key: 13,
fn: function () {
Ext.Msg.alert('title', 'enter click');
},
scope: this
}
]
);
}
},