左边是一个动态树,点击一个叶子节点(模块),左边新增一个tab,同这个tab中包含一个grid用作显示数据。
怎么弄?
我的自己代码不行。如下:
动态树的监听。
listeners :{'click':function(node){
if(node.isLeaf()){
tabs.remove(tabs.getComponent('item'+node.id));
addTab(node.text,node.id,'grid'); }else{
return;
}
}
function addTab(title,id,uxtype){
tabs.add({
id:'item'+id,
title: title,
items:[{
xtype:'grid',
stripeRows:true,
width:600,
height:800,
title:'模块列表',
store:new Ext.data.JsonStore({
url:'moduleManagerList.action',
totalProperty:'total',
root:'syModuleManager',
remoteSort: true,
fields:['moduleName','moduleCode','parentId','url','re','moduleLevel','activity','moduleId']
}),
columns:new Ext.grid.ColumnModel([
{header:'模块名称',dataIndex:'moduleName'},
{header:'模块CODE',dataIndex:'moduleCode'},
{header:'父模块ID',dataIndex:'parentId'},
{header:'URL',dataIndex:'url'},
{header:'备注',dataIndex:'re'},
{header:'模块级别',dataIndex:'moduleLevel'},
{header:'模块关状',dataIndex:'activity'},
{header:'模块ID',dataIndex:'moduleId'}
]),
autoHeight:true
}],
closable:true
}).show(); }
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货