原文地址:http://blog.csdn.net/y6300023290/article/details/18989635

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

[javascript] view plain copy [转]extjs组件添加事件监听的三种方式[转]extjs组件添加事件监听的三种方式
  1. xtype : 'textarea',    
  2. name : 'dataSetField',    
  3. labelSeparator:'',    
  4. fieldLabel:'',    
  5. hideLabel: true,    
  6. allowBlank: true,    
  7. height: mainPanelHeight*0.8,    
  8. anchor:'99%',    
  9. listeners:{'blur':function(){    
  10.    alert(1);    
  11. }}    


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

[javascript] view plain copy [转]extjs组件添加事件监听的三种方式[转]extjs组件添加事件监听的三种方式
  1. gridPanel.on('rowdblclick',function(gridPanel,_rowIndex,e){    
  2.   alert(2);    
  3. }    


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

[javascript] view plain copy [转]extjs组件添加事件监听的三种方式[转]extjs组件添加事件监听的三种方式
    1. gridPanel.addListener('rowclick',function(){    
    2.  alert(3)}    
    3. );    

相关文章:

  • 2021-07-19
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-08-01
猜你喜欢
  • 2021-12-30
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案