52,797
社区成员
发帖
与我相关
我的任务
分享
{
xtype: "treepanel",
border: false,
autoScroll: true,
animate: false,
loader: new Ext.tree.TreeLoader({
url: "",
baseParams: {
action: ""
}
}),
root: new Ext.tree.AsyncTreeNode({
text: "文档中心",
expanded: true,
id: "0"
}),
listeners: {
click: function(node, e) {
if (node.id == "0") return;
var tabpanel = win.get(1).get(0);
var n = tabpanel.getComponent(node.id);
if (!n) {
n = tabpanel.add({
id: node.id,
title: node.text,
closable: true,
html: '<iframe id="reporter-iframe" src=\'' + node.attributes.url + '\' frameborder="0" scrolling="auto" style="border:0px none;height:100%; width:100%;"></iframe>'
});
tabpanel.setActiveTab(n);
} else {
tabpanel.setActiveTab(n);
}
}
}
}
[{ID:'5',text:'书籍信息 ',leaf:true},
{ID:'3',text:'系统管理 ',leaf:false,children:[
{ID:'8',text:'菜单管理 ',link:'manager/menumanager.aspx?MenuTreeID=8',leaf:true},
{ID:'7',text:'用户管理 ',link:'manager/usermanager.aspx?MenuTreeID=7',leaf:true},
{ID:'10',text:'角色管理 ',link:'manager/rolemanager.aspx?MenuTreeID=10',leaf:true},
{ID:'11',text:'日志管理 ',link:'manager/logmanager.aspx?MenuTreeID=11',leaf:true}]}]
不用href
menu.on('click', function (node) {
if (node.leaf == true) {
var tab = tabMain.getComponent('tab_' + node.id);
if (!tab) {
tab = new Ext.Panel({
id: 'tab_' + node.id,
closable: true,
title: node.text,
iconCls: node.attributes.iconCls,
autoScroll: true,
border: false,
layout: 'fit',
autoLoad: {
url: node.attributes.link,
scope: this,
method: 'get', //post or get
params: { subMainId: node.id }, //传值
scripts: true, //支持页面所有的dom元素
text: '页面加载中,请稍候....'
}
})
tabMain.add(tab);
}
tabMain.setActiveTab(tab);
}
});