2 hkmjia hkmjia 于 2013.07.17 09:23 提问

EXTjs自适应窗口大小问题 求大神指点

代码如下:
Ext.define('MyApp.view.MyPanel', {
extend: 'Ext.panel.Panel',

autoRender: false,
id: 'panel',
layout: {
    type: 'fit'
},
overlapHeader: true,
title: '分支机构目录',
titleAlign: 'left',
titleCollapse: false,

initComponent: function() {
    var me = this;

    Ext.applyIf(me, {
        items: [
            {
                xtype: 'treepanel',
                autoRender: false,
                id: 'treepanel',
                itemId: 'panel',
                constrain: true,
                autoScroll: true,
                defaultAlign: '[100%,100%]',
                header: false,
                title: 'My Tree Panel'
            }
        ],
        dockedItems: [
            {
                xtype: 'container',
                dock: 'bottom',
                id: 'container',
                layout: {
                    type: 'hbox'
                },
                items: [
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0',
                        width: 80,
                        allowDepress: false,
                        iconAlign: 'top',
                        iconCls: '',
                        menuAlign: 'tl----bl?',
                        text: '新增分类'
                    },
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0 ',
                        width: 80,
                        text: '修改分类'
                    },
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0 ',
                        width: 80,
                        text: '删除分类'
                    },
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0 0 ',
                        width: 100,
                        text: '新增分支机构'
                    },
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0 0',
                        width: 100,
                        text: '修改分支机构'
                    },
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0',
                        width: 100,
                        text: '删除分支机构'
                    },
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0 ',
                        width: 100,
                        text: '停用分支机构'
                    },
                    {
                        xtype: 'button',
                        margins: '7 5 0 0 ',
                        margin: '0 5 0 0',
                        width: 60,
                        text: '移动'
                    },
                    {
                        xtype: 'container',
                        flex: 1,
                        layout: {
                            align: 'middle',
                            pack: 'end',
                            type: 'hbox'
                        },
                        items: [
                            {
                                xtype: 'button',
                                margins: '5 5 0 0 ',
                                autoRender: false,
                                margin: '0 5 0 0 ',
                                width: 60,
                                iconAlign: 'right',
                                text: '退出'
                            },
                            {
                                xtype: 'button',
                                margins: '5 5 0 0 ',
                                margin: '0 5 0 0',
                                width: 60,
                                text: '刷新'
                            }
                        ]
                    }
                ]
            }
        ]
    });

    me.callParent(arguments);
}

});

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!