Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / src / layout / container / AbstractFit.js
1 /**
2  * @class Ext.layout.container.AbstractFit
3  * @extends Ext.layout.container.Container
4  * <p>This is a base class for layouts that contain <b>a single item</b> that automatically expands to fill the layout's
5  * container.  This class is intended to be extended or created via the <tt>layout:'fit'</tt> {@link Ext.container.Container#layout}
6  * config, and should generally not need to be created directly via the new keyword.</p>
7  * <p>FitLayout does not have any direct config options (other than inherited ones).  To fit a panel to a container
8  * using FitLayout, simply set layout:'fit' on the container and add a single panel to it.  If the container has
9  * multiple panels, only the first one will be displayed.  Example usage:</p>
10  * <pre><code>
11 var p = new Ext.panel.Panel({
12     title: 'Fit Layout',
13     layout:'fit',
14     items: {
15         title: 'Inner Panel',
16         html: '&lt;p&gt;This is the inner panel content&lt;/p&gt;',
17         border: false
18     }
19 });
20 </code></pre>
21  */
22 Ext.define('Ext.layout.container.AbstractFit', {
23
24     /* Begin Definitions */
25
26     extend: 'Ext.layout.container.Container',
27
28     /* End Definitions */
29
30     itemCls: Ext.baseCSSPrefix + 'fit-item',
31     targetCls: Ext.baseCSSPrefix + 'layout-fit',
32     type: 'fit'
33 });