var rootNode={
text:'可选择的指标对象',
expanded:true,
children:[{
text:'宽带业务指标分析',
children:[{
text:'工单处理及时率',
leaf:true
},{
text:'ADSL故障申告率',
leaf:true
},{
text:'工单处理超时率',
leaf:true
}]
},{
text:'VPN业务指标分析'
},{
text:'我的E家保障情况',
leaf:true
},{
text:'重复申告率',
leaf:true
}]
}; var staticTree={
xtype : 'treepanel',
animate : true,
id : 'staticTree',
autoScroll: true,
enableDD : true,
root : rootNode
};
我建了一个静态树,用window控件可以看到var mytree = new Ext.Window({
height : 500,
width : 400,
layout : 'fit',
border : false,
title : '我的树形',
items : staticTree
});
mytree.show();但是用TabPanel里的一个子页全显示不出来,如下var tabs = new Ext.TabPanel({
activeTab: 0,
frame:true,
items:[{
title: '指标考核',
layout:'border',
width:'auto',
/* listeners:{
activate:function(){alert('a')}
},*/
items:[{
region:'center',
title:'center'
},{
region:'west',
title:'west',
split:true,
width:300,
maxWidth:300,
items:staticTree
}]
},{
title: '过程监测'
},{
title: '指标仪表盘'
},{
title: '能耗评估'
},{
title: '更多'
}
]
});这是为什么的呢?小弟初学EXTJS,请高手们赐教
解决方案 »
- 这是空值判断咋不起作用那???
- 修改JS代码
- 本地图片文件映射到WEB工程下?
- A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive.
- 怎么模拟settimeout()那样的功能
- JS中没有大于32位的整数类型吗?
- 请教设置什么参数使showModalDialog('http://design.xuse.net')打开的窗口最大化?急!!!
- 在javacript编程中如何与后台数据库进行交互??
- 在javascript函数中,如何将取得的文本框中的数字字符串转化为数字?如何去掉字符串中的空格?
- 移动端 购物车缩小-变大-还原的效果怎么做?
- (超级求助)js this这个如何 在其他地方模拟这个this
- jsTree如何让不同的节点有不同的右键菜单
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="ext.js"></script>
<script src="ext-all-debug.js"></script>
<script src="ux-all.js"></script>
<script src="AceFilteringBar.js"></script>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="resources/css/ext-ux-all.css" />
<link rel="stylesheet" type="text/css" href="resources/css/xtheme-gray.css" />
</head>
<body>
</body>
<script>
var rootNode={
text:'可选择的指标对象',
expanded:true,
children:[{
text:'宽带业务指标分析',
children:[{
text:'工单处理及时率',
leaf:true
},{
text:'ADSL故障申告率',
leaf:true
},{
text:'工单处理超时率',
leaf:true
}]
},{
text:'VPN业务指标分析',
leaf:true
},{
text:'我的E家保障情况',
leaf:true
},{
text:'重复申告率',
leaf:true
}]
}; var staticTree={
xtype : 'treepanel',
animate : true,
id : 'staticTree',
autoScroll: true,
enableDD : true,
root : rootNode
};
var tabs = new Ext.TabPanel({
activeTab: 0,
renderTo:Ext.getBody(),
height:400,
frame:true,
items:[{
title: '指标考核',
layout:'border',
width:'auto',
/* listeners:{
activate:function(){alert('a')}
},*/
items:[{
region:'center',
title:'center'
},{
region:'west',
title:'west',
split:true,
width:300,
maxWidth:300,
items:staticTree
}]
},{
title: '过程监测'
},{
title: '指标仪表盘'
},{
title: '能耗评估'
},{
title: '更多'
}
]
}); </script>
</html>经过测试没有问题,只是tabpanel如果不设置高度的话是出不来的。希望可以帮到楼主
然后renderTo:'myPanelId'即可渲染panel.