ContainerLayout FitLayout CenterLayout
Package: | Ext.ux.layout |
Defined In: | CenterLayout.js |
Class: | CenterLayout |
Extends: | FitLayout |
This is a very simple layout style used to center contents within a container. This layout works within nested containers and can also be used as expected as a Viewport layout to center the page layout.
As a subclass of FitLayout, CenterLayout expects to have a single child panel of the container that uses the layout. The layout does not require any config options, although the child panel contained within the layout must provide a fixed or percentage width. The child panel's height will fit to the container by default, but you can specify autoHeight:true to allow it to autosize based on its content height. Example usage:
// The content panel is centered in the container
var p = new Ext.Panel({
title: 'Center Layout',
layout: 'ux.center',
items: [{
title: 'Centered Content',
width: '75%',
html: 'Some content'
}]
});
// If you leave the title blank and specify no border
// you'll create a non-visual, structural panel just
// for centering the contents in the main container.
var p = new Ext.Panel({
layout: 'ux.center',
border: false,
items: [{
title: 'Centered Content',
width: 300,
autoHeight: true,
html: 'Some content'
}]
});
Config Options | Defined By | |
---|---|---|
extraCls : String An optional extra CSS class that will be added to the container. This can be useful for adding
customized styles to t... An optional extra CSS class that will be added to the container. This can be useful for adding customized styles to the container or any of its children using standard CSS rules. See Ext.Component.ctCls also. Note: extraCls defaults to '' except for the following classes which assign a value by default:
| ContainerLayout | |
renderHidden : Boolean True to hide each contained item on render (defaults to false). | ContainerLayout |
Property | Defined By | |
---|---|---|
activeItem : Ext.Component A reference to the Ext.Component that is active. For example, if(myPanel.layout.activeItem.id == 'item-1') { ... }
a... A reference to the Ext.Component that is active. For example,
activeItem only applies to layout styles that can display items one at a time
(like Ext.layout.AccordionLayout, Ext.layout.CardLayout
and Ext.layout.FitLayout). Read-only. Related to Ext.Container.activeItem. | ContainerLayout | |
fieldTpl : Ext.Template The Ext.Template used by Field rendering layout classes (such as
Ext.layout.FormLayout) to create the DOM structure o... The Ext.Template used by Field rendering layout classes (such as
Ext.layout.FormLayout) to create the DOM structure of a fully wrapped,
labeled and styled form Field. A default Template is supplied, but this may be
overriden to create custom field structures. The template processes values returned from
Ext.layout.FormLayout.getTemplateArgs. | ContainerLayout |