[转]extjs组件添加事件监听的三种方式
原文地址:http://blog.csdn.net/y6300023290/article/details/18989635
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)}
- );