Ext border布局west中添加的树在最下边显示,求高手指点

小小白的最爱 2013-03-06 11:55:00
Ext.onReady(function(){
Ext.create('Ext.panel.Panel', {
width: 500,
height: 400,
title: 'Border Layout',
layout: 'border',
items: [{
title: 'South Region is resizable',
region: 'south', // position for region
xtype: 'panel',
height: 100,
split: true, // enable resizing
margins: '0 5 5 5'
},{
// xtype: 'panel' implied by default
title: 'West Region is collapsible',
region:'west',
xtype: 'panel',
margins: '5 0 0 5',
width: 200,
collapsible: true, // make collapsible
id: 'west-region-container',
layout: 'fit'
},{
title: 'Center Region',
region: 'center', // center region is required, no width/height specified
xtype: 'panel',
layout: 'fit',
margins: '5 5 0 0'
}],
renderTo: Ext.getBody()
});
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: "detention", leaf: true },
{ text: "homework", expanded: true, children: [
{ text: "book report", leaf: true },
{ text: "alegrbra", leaf: true}
] },
{ text: "buy lottery tickets", leaf: true }
]
}
});

var treeTest = Ext.create('Ext.tree.Panel', {
//title: 'Simple Tree',
store: store,
margins: '3 0 3 3',
cmargins: '3 3 3 3',
width: 200,
//minSize : 150,
maxSize : 200,
autoHeight:true,
store: store,
rootVisible: false,
renderTo: 'west-region-container'
});

});
...全文
116 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
小小白的最爱 2013-03-06
  • 打赏
  • 举报
回复
小小白的最爱 2013-03-06
  • 打赏
  • 举报
回复
嗯,好了,谢谢!
洋小葱 2013-03-06
  • 打赏
  • 举报
回复

 var treeTest = Ext.create('Ext.tree.Panel', {
    //title: 'Simple Tree',
     store: store,
      margins: '3 0 3 3',
    cmargins: '3 3 3 3',
    width: 200,
     //minSize : 150,   
     maxSize : 200, 
    autoHeight:true,
    store: store,
    rootVisible: false
});





        title: 'West Region is collapsible',
        region:'west',
        margin: '5 0 0 5',
        width: 200,
        collapsible: true,   // make collapsible
        layout: 'fit',
        items :[treeTest]
不要用renderTo到那个border里面试试!

87,991

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧