commit extjs-2.2.1
[extjs.git] / docs / output / Ext.layout.Accordion.html
1         <div class="body-wrap">
2         <div class="top-tools">
3             <a class="inner-link" href="#Ext.layout.Accordion-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4             <a class="inner-link" href="#Ext.layout.Accordion-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5             <a class="inner-link" href="#Ext.layout.Accordion-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6                             <a class="inner-link" href="#Ext.layout.Accordion-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7                         <a class="bookmark" href="../docs/?class=Ext.layout.Accordion"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8         </div>
9                 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.layout.ContainerLayout" ext:member="" href="output/Ext.layout.ContainerLayout.html">ContainerLayout</a>
11   <img src="resources/elbow-end.gif"/><a ext:cls="Ext.layout.FitLayout" ext:member="" href="output/Ext.layout.FitLayout.html">FitLayout</a>
12     <img src="resources/elbow-end.gif"/>Accordion</pre></div>
13                 <h1>Class Ext.layout.Accordion</h1>
14         <table cellspacing="0">
15             <tr><td class="label">Package:</td><td class="hd-info">Ext.layout</td></tr>
16             <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/AccordionLayout.js" target="_blank">AccordionLayout.js</a></td></tr>
17             <tr><td class="label">Class:</td><td class="hd-info">Accordion</td></tr>
18                                     <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.layout.FitLayout" ext:member="" href="output/Ext.layout.FitLayout.html">FitLayout</a></td></tr>
19                     </table>
20         <div class="description">
21             *
22 <p>This is a layout that contains multiple panels in an expandable accordion style such that only one
23 panel can be open at any given time.  Each panel has built-in support for expanding and collapsing.
24 This class is intended to be extended or created via the layout:'accordion' <a ext:cls="Ext.Container" ext:member="layout" href="output/Ext.Container.html#layout">Ext.Container.layout</a>
25 config, and should generally not need to be created directly via the new keyword.</p>
26 <p>Note that when creating a layout via config, the layout-specific config properties must be passed in via
27 the <a ext:cls="Ext.Container" ext:member="layoutConfig" href="output/Ext.Container.html#layoutConfig">Ext.Container.layoutConfig</a> object which will then be applied internally to the layout.
28 Example usage:</p>
29 <pre><code>var accordion = <b>new</b> Ext.Panel({
30     title: <em>'Accordion Layout'</em>,
31     layout:<em>'accordion'</em>,
32     defaults: {
33         <i>// applied to each contained panel</i>
34         bodyStyle: <em>'padding:15px'</em>
35     },
36     layoutConfig: {
37         <i>// layout-specific configs go here</i>
38         titleCollapse: false,
39         animate: true,
40         activeOnTop: true
41     },
42     items: [{
43         title: <em>'Panel 1'</em>,
44         html: <em>'&lt;p&gt;Panel content!&lt;/p&gt;'</em>
45     },{
46         title: <em>'Panel 2'</em>,
47         html: <em>'&lt;p&gt;Panel content!&lt;/p&gt;'</em>
48     },{
49         title: <em>'Panel 3'</em>,
50         html: <em>'&lt;p&gt;Panel content!&lt;/p&gt;'</em>
51     }]
52 });</code></pre>        </div>
53         
54         <div class="hr"></div>
55                 <a id="Ext.layout.Accordion-configs"></a>
56         <h2>Config Options</h2>
57         <table cellspacing="0" class="member-table">
58             <tr>
59                 <th class="sig-header" colspan="2">Config Options</th>
60                 <th class="msource-header">Defined By</th>
61             </tr>
62                 <tr class="config-row expandable">\r
63         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
64         <td class="sig">\r
65         <a id="Ext.layout.Accordion-activeOnTop"></a>\r
66             <b>activeOnTop</b> : Boolean            <div class="mdesc">\r
67                         <div class="short">True to swap the position of each panel as it is expanded so that it becomes the first item in the container, false t...</div>\r
68             <div class="long">\r
69                 True to swap the position of each panel as it is expanded so that it becomes the first item in the container, false to keep the panels in the rendered order. <b>This is NOT compatible with "animate:true"</b> (defaults to false).            </div>\r
70                         </div>\r
71         </td>\r
72         <td class="msource">Accordion</td>\r
73     </tr>\r
74         <tr class="config-row alt expandable">\r
75         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
76         <td class="sig">\r
77         <a id="Ext.layout.Accordion-animate"></a>\r
78             <b>animate</b> : Boolean            <div class="mdesc">\r
79                         <div class="short">True to slide the contained panels open and closed during expand/collapse using animation, false to open and close di...</div>\r
80             <div class="long">\r
81                 True to slide the contained panels open and closed during expand/collapse using animation, false to open and close directly with no animation (defaults to false). Note: to defer to the specific config setting of each contained panel for this property, set this to undefined at the layout level.            </div>\r
82                         </div>\r
83         </td>\r
84         <td class="msource">Accordion</td>\r
85     </tr>\r
86         <tr class="config-row expandable">\r
87         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
88         <td class="sig">\r
89         <a id="Ext.layout.Accordion-autoWidth"></a>\r
90             <b>autoWidth</b> : Boolean            <div class="mdesc">\r
91                         <div class="short">True to set each contained item's width to 'auto', false to use the item's current width (defaults to true). Note tha...</div>\r
92             <div class="long">\r
93                 True to set each contained item's width to 'auto', false to use the item's current width (defaults to true). Note that some components, in particular the <a ext:cls="Ext.grid.GridPanel" href="output/Ext.grid.GridPanel.html">grid</a>, will not function properly within layouts if they have auto width, so in such cases this config should be set to false.            </div>\r
94                         </div>\r
95         </td>\r
96         <td class="msource">Accordion</td>\r
97     </tr>\r
98         <tr class="config-row alt expandable">\r
99         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
100         <td class="sig">\r
101         <a id="Ext.layout.Accordion-collapseFirst"></a>\r
102             <b>collapseFirst</b> : Boolean            <div class="mdesc">\r
103                         <div class="short">True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools in the cont...</div>\r
104             <div class="long">\r
105                 True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools in the contained panels' title bars, false to render it last (defaults to false).            </div>\r
106                         </div>\r
107         </td>\r
108         <td class="msource">Accordion</td>\r
109     </tr>\r
110         <tr class="config-row inherited expandable">\r
111         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
112         <td class="sig">\r
113         <a id="Ext.layout.Accordion-extraCls"></a>\r
114             <b>extraCls</b> : String            <div class="mdesc">\r
115                         <div class="short">An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding custo...</div>\r
116             <div class="long">\r
117                 An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding customized styles to the container or any of its children using standard CSS rules.            </div>\r
118                         </div>\r
119         </td>\r
120         <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#extraCls" href="output/Ext.layout.ContainerLayout.html#extraCls">ContainerLayout</a></td>\r
121     </tr>\r
122         <tr class="config-row alt expandable">\r
123         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
124         <td class="sig">\r
125         <a id="Ext.layout.Accordion-fill"></a>\r
126             <b>fill</b> : Boolean            <div class="mdesc">\r
127                         <div class="short">True to adjust the active item's height to fill the available space in the container, false to use the item's current...</div>\r
128             <div class="long">\r
129                 True to adjust the active item's height to fill the available space in the container, false to use the item's current height, or auto height if not explicitly set (defaults to true).            </div>\r
130                         </div>\r
131         </td>\r
132         <td class="msource">Accordion</td>\r
133     </tr>\r
134         <tr class="config-row expandable">\r
135         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
136         <td class="sig">\r
137         <a id="Ext.layout.Accordion-hideCollapseTool"></a>\r
138             <b>hideCollapseTool</b> : Boolean            <div class="mdesc">\r
139                         <div class="short">True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false). When se...</div>\r
140             <div class="long">\r
141                 True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false). When set to true, <a ext:cls="Ext.layout.Accordion" ext:member="titleCollapse" href="output/Ext.layout.Accordion.html#titleCollapse">titleCollapse</a> should be true also.            </div>\r
142                         </div>\r
143         </td>\r
144         <td class="msource">Accordion</td>\r
145     </tr>\r
146         <tr class="config-row inherited alt">\r
147         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
148         <td class="sig">\r
149         <a id="Ext.layout.Accordion-renderHidden"></a>\r
150             <b>renderHidden</b> : Boolean            <div class="mdesc">\r
151                             True to hide each contained item on render (defaults to false).                        </div>\r
152         </td>\r
153         <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#renderHidden" href="output/Ext.layout.ContainerLayout.html#renderHidden">ContainerLayout</a></td>\r
154     </tr>\r
155         <tr class="config-row">\r
156         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
157         <td class="sig">\r
158         <a id="Ext.layout.Accordion-sequence"></a>\r
159             <b>sequence</b> : Boolean            <div class="mdesc">\r
160                             <b>Experimental</b>. If animate is set to true, this will result in each animation running in sequence.                        </div>\r
161         </td>\r
162         <td class="msource">Accordion</td>\r
163     </tr>\r
164         <tr class="config-row alt expandable">\r
165         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
166         <td class="sig">\r
167         <a id="Ext.layout.Accordion-titleCollapse"></a>\r
168             <b>titleCollapse</b> : Boolean            <div class="mdesc">\r
169                         <div class="short">True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow expand/co...</div>\r
170             <div class="long">\r
171                 True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow expand/collapse only when the toggle tool button is clicked (defaults to true). When set to false, <a ext:cls="Ext.layout.Accordion" ext:member="hideCollapseTool" href="output/Ext.layout.Accordion.html#hideCollapseTool">hideCollapseTool</a> should be false also.            </div>\r
172                         </div>\r
173         </td>\r
174         <td class="msource">Accordion</td>\r
175     </tr>\r
176             </table>
177                 <a id="Ext.layout.Accordion-props"></a>
178         <h2>Public Properties</h2>
179                 <table cellspacing="0" class="member-table">
180             <tr>
181                 <th class="sig-header" colspan="2">Property</th>
182                 <th class="msource-header">Defined By</th>
183             </tr>
184                 <tr class="property-row inherited expandable">\r
185         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
186         <td class="sig">\r
187         <a id="Ext.layout.Accordion-activeItem"></a>\r
188             <b>activeItem</b> : Ext.Component            <div class="mdesc">\r
189                         <div class="short">
190 A reference to the Ext.Component that is active.  For example,
191 if(myPanel.layout.activeItem.id == 'item-1') { ... }....</div>\r
192             <div class="long">\r
193                 
194 A reference to the <a ext:cls="Ext.Component" href="output/Ext.Component.html">Ext.Component</a> that is active.  For example,
195 if(myPanel.layout.activeItem.id == 'item-1') { ... }.  activeItem only applies to layout styles that can
196 display items one at a time (like <a ext:cls="Ext.layout.Accordion" href="output/Ext.layout.Accordion.html">Ext.layout.Accordion</a>, <a ext:cls="Ext.layout.CardLayout" href="output/Ext.layout.CardLayout.html">Ext.layout.CardLayout</a>
197 and <a ext:cls="Ext.layout.FitLayout" href="output/Ext.layout.FitLayout.html">Ext.layout.FitLayout</a>).  Read-only.  Related to <a ext:cls="Ext.Container" ext:member="activeItem" href="output/Ext.Container.html#activeItem">Ext.Container.activeItem</a>.            </div>\r
198                         </div>\r
199         </td>\r
200         <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#activeItem" href="output/Ext.layout.ContainerLayout.html#activeItem">ContainerLayout</a></td>\r
201     </tr>\r
202             </table>
203                 <a id="Ext.layout.Accordion-methods"></a>
204         <h2>Public Methods</h2>
205         <div class="no-members">This class has no public methods.</div>        <a id="Ext.layout.Accordion-events"></a>
206         <h2>Public Events</h2>
207         <div class="no-members">This class has no public events.</div>
208         </div>