ExtJs Layout: Can't display Ext.form.Panel

1k views Asked by At

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

My 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

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;
}

Grid View

2

There are 2 answers

0
Wes Grant On BEST ANSWER

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. 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();
0
CD.. On

Any Container using the Border layout must have a child item with region:'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