O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Anchor components to their parent's dimensions

We can use the Ext.layout.container.Anchor class to size a child component relative to the dimensions of its parent. This class inherits from the Ext.layout.container.Container layout which means that by default a component that has the Anchor layout will have its children flow vertically within it one after another.

The Anchor layout gives us four options for defining the size of a child component. The first, and most popular, is a simple percentage value which is used to calculate the child's width and height based on the parent's dimensions (or the defined anchorSize property, see There's more... for further details).

The second option is a basic offset value that will size the child to the parent's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required