PDA

View Full Version : Panel Disapears When Layout is NOT 'fit'



Supial
23 Jan 2012, 7:42 AM
Greetings,
This is a follow up to the following thread.
http://www.sencha.com/forum/showthread.php?175371-Panel-Disappears-When-Collapsed

Below is a code sample that shows a panel with several components, and when the panel is collapsed, the entire panel disapears and can not be expanded. If a layout is not specified I believe that the default is 'auto' so therefore a layout config is always defined.



Ext.require([
'*'
]);

Ext.onReady(function() {
Ext.create('Ext.container.Viewport',{
id:'viewport',
layout:'border',
items: [{
region:'north',
id:'northbanner',
autoHeight:true,
html:'<H1>BANNER GOES HERE</H1>'
},{
region:'west',
id:'utilpanel',
minWidth:200,
maxWidth:400,
split:true
},{
region:'center',
layout: {type:'table',columns:1,tableAttrs:{style:{width:'100%'}}},
id:'page'
}]
});

// This is done purposly as this is how my server needs to generate the code.
Ext.getCmp('page').add({
xtype:'panel',
id:'activities',
layout:'border',
border:true,
collapsible:true,
title:'My Activities test',
style:{padding:2},
height: 225,
items:[
{
xtype:'datepicker',
id:'alertsDate',
format: 'm/d/Y',
region: 'east',
disabledDatesText:'Disabled',
disabledDaysText:'Disabled',
minText:'The date in this field must be equal to or after {0}',
maxText:'The date in this field must be equal to or before {0}',
toYYYYMMDD: function() {
var me = this;
return me.getValue() != null ? (Ext.isDate(me.getValue()) ? Ext.Date.format(new Date(me.getValue()),'Ymd') : me.getValue()) : '';
}
},{
region: 'center',
id:'regc',
html: '<p>Grid</p>'
}
]
});
});


If the 'center' panel (id:'page') is set to 'fit' then the panel is collapsed properly. Any other layout config seems to remove the panel entirely. Is there something wrong with the code, or is this a bug?

Cheers,
Marcel

skirtle
23 Jan 2012, 10:38 AM
Have you tried it against 4.1.0-beta-1? I've not tried your exact scenario but it sounds similar to other scenarios I have tried and the 4.1 beta seemed much better in that regard.

Supial
23 Jan 2012, 6:29 PM
I just tried the same code in 4.1.0-beta-1 and it did work.

However, I'm not going to be able to use 4.1 since there is no release date and I can't commit to it without a release date. Will 4.0.7 be fixed so that it too works as expected?

This definatley seems like a bug then in 4.0.7.

Thanks,
Marcel

skirtle
24 Jan 2012, 7:13 AM
Latest on 4.1.0:

http://www.sencha.com/forum/showthread.php?175599

I'd be surprised if there's another release on the 4.0 line.