在login.js中定义好文本框
{
xtype:'textfield',
name:'pwd',
inputType:'password',
fieldLabel:'密码',
allowBlank:false,
// enableKeyEvents: true, //文档中说要设置为true才能生效,我的没弄
listeners: {
specialKey: "onSpecialKey"
}
},
在controller中写好逻辑
onSpecialKey: function(field, e) {
if(e.getKey() == e.ENTER) {
this.onLoginClick();
}
},
onLoginClick: function(){
//登录
}