PDA

View Full Version : [3.2] FIT layout and panels



Stju
6 Apr 2010, 1:53 PM
Fit layout behaves incorrectly.

Intended result:
All three panels fitted evenly in viewport's center region.

Observed result:
First panel takes up more than all height in viewport, other panels are below and invisible.



Ext.onReady(function(){
var first = new Ext.Panel({
title:'first',
collapsible:true,
html:'Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>'
});

var second = new Ext.Panel({
title:'second',
collapsible:true,
html:'Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>'
});

var third = new Ext.Panel({
title:'third',
collapsible:true,
html:'Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>Lorem Ipsum is simply dummy text<br> of the printing and typesetting industry.<br>'
});

var centerItem= new Ext.Container({
region:'center',
layout:'fit', // <- FIT DOES NOT FIT!
items:[first, second,third]
});

var view = new Ext.Viewport({
layout:'border',
items:[centerItem]
});
});

evant
6 Apr 2010, 5:35 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.layout.FitLayout



This is a base class for layouts that contain a single item that automatically expands to fill the layout's container.