PDA

View Full Version : [E] Layout run failed



hermann.s
11 Dec 2013, 9:51 AM
Greetings,

I have a hidden window that I want to show when a button is clicked.
However it won't work with an hbox layout type. It works fine with vbox though.

The window :

Ext.define('MCS.view.case.history.HistoryWindow', {
extend: 'Ext.window.Window',
alias: 'widget.historyWindow',

itemId: 'historyWindow',
title: 'Case History',

width: 640,
height: 400,

closable: false,
closeAction: 'hide',
hideMode: 'offsets',

layout: { type: 'vbox', align: 'stretch' },

modal: false,

items:
[
{ xtype: 'historyGrid'},
{
xtype: 'container',
items:
[
{ xtype: 'container', items: [{ xtype: 'label' }] },
{ xtype: 'container', items: [{ xtype: 'textfield' }, { xtype: 'textfield' }] },
{ xtype: 'container', items: [{ xtype: 'textfield' }, { xtype: 'textfield' }] },
{ xtype: 'container', items: [{ xtype: 'panel' }, { xtype: 'panel' }, { xtype: 'panel' }] }
]
},
],

initComponent: function () {

this.callParent();
}
});


The method that is executed when the button is clicked :

toggleHistoryWindow: function () {
if (Ext.ComponentQuery.query('window#historyWindow')[0].hidden) {
Ext.ComponentQuery.query('window#historyWindow')[0].show();
}
else {
Ext.ComponentQuery.query('window#historyWindow')[0].close();
}
},

evant
11 Dec 2013, 10:02 AM
You'll need to post a runnable test case, there's too much information missing:

https://fiddle.sencha.com