1.对文本操作时失去焦点或者获取焦点触发事件
var this = me,
var feild = Ext.create("Ext.form.field.Text",{
anchor: "100%",
fieldLabel: "标题",
labelAlign: "right",
labelWidth: 110,
allowBlank:false,
name:"custName",
listeners:{
//失去焦点
blur:function(){
me.fireEvent('fire',me);
},
//获取焦点
focus:function(){
me.fireEvent('getfire',me);
}
}
});
2.文本输入时触发事件
var me = this;
me.TextField = Ext.create("Ext.form.field.Text",{
anchor: "100%",
fieldLabel: "标题",
labelAlign: "right",
labelWidth: 110,
allowBlank:false,
name:"custName"
});
//绑定事件
me.TextField .on('change',function(){
//触发的事件
me.dosome();
});
dosome:function(){
//要实现的逻辑
}