我正在使用ExtJS 6,在Project中正在使用,textfield
但是我的列表器不起作用。我做错了什么吗?有人可以帮我吗?
我的代码示例。
Ext.create('Ext.form.Panel', {
title: 'Contact Info',
width: 300,
bodyPadding: 10,
renderTo: Ext.getBody(),
items: [{
xtype: 'textfield',
name: 'name',
fieldLabel: 'Name',
allowBlank: false,
listeners: {
keypress : function() {
alert("Name")
}
}
}, {
xtype: 'textfield',
name: 'email',
fieldLabel: 'Email Address',
vtype: 'email',
listeners: {
keypress : function() {
alert("Email")
}
}
}]
});
出于性能的考虑,keypress
,keydown
,keyup
事件默认情况下禁用,并且必须使用被启用enableKeyEvents:true
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句