Ext.eim.EIMPanel = function (config){ this.eiGrid = new Ext.eim.EIGrid({ tbar : [ {xtype:'button',text:'新增',listeners : {click : this.addEI}}, {xtype:'button',text:'修改',listeners : {click : this.modifyEI}} ] }); Ext.apply(this, config,{ id : 'xxxxx', renderTo : 'content', title : 'xxxxxx', width : 1000 , height : 800 , items : [{html:'查询',border : false },{title:'xxxx',items:this.eiGrid}] }); Ext.eim.EIMPanel.superclass.constructor.call(this); } Ext.extend(Ext.eim.EIMPanel,Ext.Panel,{ query : function(){ var params = { operationDesc:'', EIDesc:'' }; this.eiGri.updateStore(params); }, query : function(){ }, modifyEI : function(){ alert('into'); }, addEI : function(){ var newEI = new Ext.Window({ width : 200 , height : 140 , title: 'xxxxx', modal : true , border : false, defaults :{ bodyStyle:'padding: 30px 20px 30px 50px' }, items:[ {items :[ {xtype:'button',text:'xxxxx',handler : function (){ }}, {border:false,html:'',height:10}, {xtype:'button',text:'xxxxxx',handler : this.modifyEI} ]} ] }); newEI.show(); } });
奇怪的CODE第6行,可以调用成功this.modifyEI,执行ALERT,而55行this.modifyEI却没有执行。为什么?
1 楼
lanseduibai
2011-01-03
这个问题解决了吗?我好像遇到同样的问题了。
2 楼
fengchong719
2012-03-29
其实只需要有this.modifyEI.createDelegate(this),应该就可以解决上述问题。