首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

Ext border布局west中添加的树在最上边显示,求

2013-03-16 
Ext border布局west中添加的树在最下边显示,求高手指点 Ext.onReady(function(){Ext.create(Ext.panel.Pa

Ext border布局west中添加的树在最下边显示,求高手指点
 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'
});
   
});
border ext tree layout
[解决办法]


 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里面试试!

热点排行
Bad Request.