【发布时间】:2013-02-01 15:59:29
【问题描述】:
您好,下面的代码我的输入事件永远不会触发,我们将不胜感激。
items: [{
xtype: 'textfield',
id: 'idhere',
name: 'namehere',
fieldLabel: 'lablehere:',
width: 500,
handler: {
key:13,
fn : function () {
if (e.getKey() == e.ENTER) {
alert("You pressed an enter button in text field.");
}
}
}
},{
xtype: 'button',
text: 'texttodisplay',
handler: function() {
//my function.
}
}]
我实际上通过以下方式解决了这个问题:
listeners: {
specialkey: function (f,e) {
if (e.getKey() == e.ENTER) {
loadData();
}
}
}
【问题讨论】:
标签: javascript extjs keyboard-events enter