PDA

View Full Version : Regions now require width to render properly



tangix
1 Dec 2011, 4:49 AM
Moving a prototype project from 4.0.7 to 4.1-pr1 and I found the following difference causing my to change some code (to the better...)

4.0.7 lets me get away with the following definition of a Border region:

{
xtype: 'navtree',
region: 'west',
split: true,
minWidth: 250
}

With 4.1-pr1 I need to specifically add a width: property otherwise the west region will be 100% width.

mitchellsimoens
1 Dec 2011, 9:41 AM
Using this code:


Ext.create('Ext.container.Viewport', {
layout : 'border',
items : [
{
region : 'west',
split : true
},
{
region : 'center'
}
]
});

Both 4.0.7, 4.1-PR1, and out latest code in git produce the same results.

Using this code in 3.4.0 and it produces the same results as the 4.x did:


new Ext.Viewport({
layout : 'border',
items : [
{
region : 'west',
split : true
},
{
region : 'center'
}
]
});

dongryphon
1 Dec 2011, 9:35 PM
Moving a prototype project from 4.0.7 to 4.1-pr1 and I found the following difference causing my to change some code (to the better...)

4.0.7 lets me get away with the following definition of a Border region:

{
xtype: 'navtree',
region: 'west',
split: true,
minWidth: 250
}

With 4.1-pr1 I need to specifically add a width: property otherwise the west region will be 100% width.

Perhaps a complete example would help, but I'll take a stab. The meaning of no width is "auto width" which can be counter-intuitive at times. The navtree is not a built-in xtype, so I am not sure what it contains. If you try something like a simple panel with some text or a basic component, I imagine that it will auto-width as you might expect. Trees, being tables, may expand.

tangix
1 Dec 2011, 10:13 PM
navtree is (as you may have guessed) a subclassed Tree panel.
I have added "width" and now everything works in both 4.0.7 and 4.1-PR1... don't know why. If I remove "width" everything is fine now, but I have added other stuff to the panels so maybe the layout is now completely satisfied?

Thanks,
/Mattias