1 post tagged layouts

Ext.ux.layout.FillContainer

One of the pages on the Ext JS app I'm currently working on has a form with a grid underneath. The page exists as a tab inside an Ext.TabPanel, and uses the border layout, with the form as the 'north' component and the grid as 'center'.

The trouble with this is that the grid shrinks down to an unusable size when the browser window is too small, ending up like this:

We could alternatively use a basic container layout, but this limits us to a fixed height for the grid, meaning we waste space at the bottom:

Enter the imaginatively named FillContainer:

new Ext.Panel({
autoScroll: true,
layout: 'fillcontainer',
items : [
{
html : 'Pretend this is a form',
height: 400
},
{
html : 'And this is the grid',
minHeight : 250,
fillContainer: true
}
]
});

If our containing panel shrinks to less than 650px in height, the grid will be automatically sized to 250px and a vertical scrollbar will appear on the panel, like this:

Continue reading