extjs组件添加事件监听的三种方式

1.在定义组件配置的时候设置

xtype : 'textarea',  
name : 'dataSetField',  
labelSeparator:'',  
fieldLabel:'',  
hideLabel: true,  
allowBlank: true,  
height: mainPanelHeight*0.8,  
anchor:'99%',  
listeners:{'blur':function(){  
   alert(1);  
}}  

2.对组件变量通过on设置

gridPanel.on('rowdblclick',function(gridPanel,_rowIndex,e){  
  alert(2);  
}  

3.通过组件变量方法addListener()设置

gridPanel.addListener('rowclick',function(){  
 alert(3)}  
);  


你可能感兴趣的:(Extjs)