ITeye博客

EXTJS 内建函数调用问题

fengchong719 · 2010-03-23 15:31 · ext · Web前端 · HTML · EXT · Markdown


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却没有执行。为什么?

评论(2)

  1. #2 楼 · fengchong719 · 2012-03-29 09:33

    其实只需要有this.modifyEI.createDelegate(this),应该就可以解决上述问题。

  2. #1 楼 · lanseduibai · 2011-01-03 18:32

    这个问题解决了吗?我好像遇到同样的问题了。

评论功能维护中,当前仅展示历史评论。