Extjs 在Ext.panel.panel中输入侦听器
您好,我想在Ext.panel.panel上为键盘上的单击按钮输入功能,我这样做是为了: 扩展:“Ext.window.window”:Extjs 在Ext.panel.panel中输入侦听器,extjs,Extjs,您好,我想在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.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
}
]
);
}
},
开发人员工具控制台中是否有任何错误输出?控制台中没有任何输出。