小弟写了 一个Ext的小例子,,,在一个树的节点上添加了一个点击事件,事件执行的结果是在一个tabPanel中添加一个panel,panel中显示的内容是panel的autoload中传入的url指向的页面内容,但是结果panel创建出来了,内容却没有显示出来。。请问各位大哥们如何解决。。。。
以下是添加panel的函数定义:
//新建标签页。title是新标签页的标题。
addTab:function(id,title,html_url) {
//判断此tab页是否已经存在,存在则只是激活显示。否则才新建一个tab页。
if(Ext.get(id) == null){
this.add({
xtype : "panel",
id: id,
title: title,
iconCls: 'tabs',
closable:true,
autoload : {
url : html_url,
params : {},
scope : this,
scripts : true
}
}).show();
}
else{
this.setActiveTab(id);
}
}
这个方法是在点一个树节点之后调用的。
//给westChild1的节点添加上点击事件---在中间的面板中添加一个tab
westChild1.on("click",function(node,event){
var tp = this.ownerCt.ownerCt.items.items[2];
alert(node.attributes.html_url);
tp.addTab(node.attributes.id+"_tab",node.attributes.text,node.attributes.html_url);
});
测试中alert能打印出url,panel能添加到tabPanel中,但其中没有内容。。