extjs listeners用法
extjs listeners用法
例如有这么一段代码,其中的listeners在这里是什么意思,如何使用
items:[
app.loginForm=new Ext.form.FormPanel({
labelAlign:'left',
buttonAlign:'center',
bodyStyle:'padding:5px',
frame:true,
labelWidth:80,
items:[
{
xtype:'textfield',
name:'txt1',
fieldLabel:'用户名称',
allowBlank :false,
anchor:'90%',
enableKeyEvents:true,
listeners:{
keypress:function(field,e){
if(e.getKey()==13){
var obj=app.loginForm.form.findField("txt2");
if(obj) {
obj.focus();
}
}
}
}},