简体   繁体   English

ExtJs布局:无法显示Ext.form.Panel

[英]ExtJs Layout: Can't display Ext.form.Panel

Hello im trying to display my Filter Panel but it doenst work anybody an idea why? 您好,我试图显示我的“筛选器面板”,但是有人知道为什么它起作用了吗? im tryed to set my window.js to layout: 'border' but without success i found some examples @ sencha but im failed sencha layouts 即时通讯试图将我的window.js设置为布局:“边框”,但未成功,我发现了一些示例@ sencha,但即时通讯sencha布局失败

My window.js 我的window.js

Ext.define('Shopware.apps.UnSqlReader.view.window.Window', {
extend: 'Enlight.app.Window',
alias: 'widget.main-window-view',
height: '90%',
width: '90%',
layout: 'fit',
title: '{s name=window_title}SQL Reader{/s}',
minimizable: true,
maximizable: true,
menuDisabled: true,
enableCtxMenu: false,
initComponent: function() {
    var me = this;
    me.items = me.getItems();
    me.callParent(arguments);
},
getItems: function() {
    var me = this;
    me.filterGrid = Ext.create('Ext.grid.Panel', {
        height: '90%',
        width: '90%',
        autoScroll: true,
        hidden: true,
        cls: 'enable-scroll-bar',
        layout: 'border',
        split: true,
        overflowX: 'scroll',
        overflowY: 'scroll',
        items: [
        Ext.create('Shopware.apps.UnSqlReader.view.filter.Filter', {
            region: 'west'
        })],
        columns: [],
    });
    return [me.filterGrid, me.grid];
},

My filter.js 我的filter.js

Ext.define('Shopware.apps.UnSqlReader.view.filter.Filter', {
extend: 'Ext.form.Panel',
title: 'Filter',
collapsible: true,
width: 300,
layout: 'anchor',
region: 'west',
initComponent: function() {
    var me = this;
    console.log('Filter Loaded');
    me.items = [
    me.createFilterButton(),
    me.createResetButton()],
    me.callParent();
},
createFilterButton: function() {
    var me = this;
    me.filterButton = Ext.create('Ext.button.Button', {
        cls: 'secondary small',
        width: 130,
        iconCls: 'sprite-funnel',
        text: 'Set Filter',
        handler: function() {

        }
    });
    return me.filterButton;
},
createResetButton: function() {
    var me = this;
    me.resetButton = Ext.create('Ext.button.Button', {
        cls: 'secondary small',
        width: 130,
        iconCls: 'sprite-funnel--minus',
        text: 'Reset Filter',
        handler: function() {}
    });
    return me.resetButton;
}

网格视图

Any Container using the Border layout must have a child item with region:'center'. 任何使用“边框”布局的“容器”都必须有一个子项,其区域为“ center”。 The child item in the center region will always be resized to fill the remaining space not used by the other regions in the layout. 中心区域中的子项将始终调整大小以填充布局中其他区域未使用的剩余空间。

http://docs.sencha.com/extjs/4.1.1/#!/api/Ext.layout.container.Border http://docs.sencha.com/extjs/4.1.1/#!/api/Ext.layout.container.Border

I was having trouble getting a Panel to show over my existing single page application. 我无法让面板显示在我现有的单页应用程序上。 I found that using an Ext.window.Window as a container for my popup dialog was really what I wanted. 我发现使用Ext.window.Window作为弹出对话框的容器确实是我想要的。 It displayed just fine: 它显示得很好:

Ext.create('Ext.window.Window', {
    title: 'Hello',
    height: 200,
    width: 400,
    layout: 'fit',
    items: {  // Let's put an empty grid in just to illustrate fit layout
        xtype: 'grid',
        border: false,
        columns: [{header: 'World'}],                 // One header just for show. There's no data,
        store: Ext.create('Ext.data.ArrayStore', {}) // A dummy empty data store
    }
}).show();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM