|
|
/*This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License UsageThis file may be used under the terms of the GNU General Public License version 3.0 aspublished by the Free Software Foundation and appearing in the file LICENSE included in thepackaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales departmentat http://www.sencha.com/contact.
Build date: 2013-04-03 15:07:25*/Ext.data.JsonP.Ext_layout_CardLayout({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.layout.FitLayout","uses":[],"html":"<div><pre class=\"hierarchy\"><h4>Hierarchy</h4><div class='subclass first-child'><a href='#!/api/Ext.layout.ContainerLayout' rel='Ext.layout.ContainerLayout' class='docClass'>Ext.layout.ContainerLayout</a><div class='subclass '><a href='#!/api/Ext.layout.FitLayout' rel='Ext.layout.FitLayout' class='docClass'>Ext.layout.FitLayout</a><div class='subclass '><strong>Ext.layout.CardLayout</strong></div></div></div><h4>Files</h4><div class='dependency'><a href='source/CardLayout.html#Ext-layout-CardLayout' target='_blank'>CardLayout.js</a></div></pre><div class='doc-contents'><p>This layout manages multiple child Components, each fitted to the Container, where only a single child Component can be\nvisible at any given time. This layout style is most commonly used for wizards, tab implementations, etc.\nThis class is intended to be extended or created via the layout:'card' <a href=\"#!/api/Ext.Container-cfg-layout\" rel=\"Ext.Container-cfg-layout\" class=\"docClass\">Ext.Container.layout</a> config,\nand should generally not need to be created directly via the new keyword.</p>\n\n\n<p>The CardLayout's focal method is <a href=\"#!/api/Ext.layout.CardLayout-method-setActiveItem\" rel=\"Ext.layout.CardLayout-method-setActiveItem\" class=\"docClass\">setActiveItem</a>. Since only one panel is displayed at a time,\nthe only way to move from one Component to the next is by calling setActiveItem, passing the id or index of\nthe next panel to display. The layout itself does not provide a user interface for handling this navigation,\nso that functionality must be provided by the developer.</p>\n\n\n<p>In the following example, a simplistic wizard setup is demonstrated. A button bar is added\nto the footer of the containing panel to provide navigation buttons. The buttons will be handled by a\ncommon navigation routine -- for this example, the implementation of that routine has been ommitted since\nit can be any type of custom logic. Note that other uses of a CardLayout (like a tab control) would require a\ncompletely different implementation. For serious implementations, a better approach would be to extend\nCardLayout to provide the custom functionality needed. Example usage:</p>\n\n\n<pre><code>var navHandler = function(direction){\n // This routine could contain business logic required to manage the navigation steps.\n // It would call setActiveItem as needed, manage navigation button state, handle any\n // branching logic that might be required, handle alternate actions like cancellation\n // or finalization, etc. A complete wizard implementation could get pretty\n // sophisticated depending on the complexity required, and should probably be\n // done as a subclass of CardLayout in a real-world implementation.\n};\n\nvar card = new <a href=\"#!/api/Ext.Panel\" rel=\"Ext.Panel\" class=\"docClass\">Ext.Panel</a>({\n title: 'Example Wizard',\n layout:'card',\n activeItem: 0, // make sure the active item is set on the container config!\n bodyStyle: 'padding:15px',\n defaults: {\n // applied to each contained panel\n border:false\n },\n // just an example of one possible navigation scheme, using buttons\n bbar: [\n {\n id: 'move-prev',\n text: 'Back',\n handler: navHandler.createDelegate(this, [-1]),\n disabled: true\n },\n '->', // greedy spacer so that the buttons are aligned to each side\n {\n id: 'move-next',\n text: 'Next',\n handler: navHandler.createDelegate(this, [1])\n }\n ],\n // the panels (or \"cards\") within the layout\n items: [{\n id: 'card-0',\n html: '<h1>Welcome to the Wizard!</h1><p>Step 1 of 3</p>'\n },{\n id: 'card-1',\n html: '<p>Step 2 of 3</p>'\n },{\n id: 'card-2',
|