Ext JS gives us the ability to stack components on top of one another allowing us to only show a single item at once and have the option to switch between them as we wish. There are several possible use cases for this type of layout, for example, a wizard style form, a content carousel, or a tabbed layout.
The Ext.tab.TabPanel
component is in fact based on the card layout and uses it to manage the tabs' layout.
In this recipe, we will demonstrate how to use the Ext.layout.container.Card
layout manager to create a simple account creation wizard as shown in the following screenshot:
We start by creating our wrapping
Ext.panel.Panel
which will contain each of our cards:var panel = Ext.create('Ext.panel.Panel', { title: 'Account Creation Wizard - Card Layout', width: 350, height: 300, renderTo: Ext.getBody() });
We now create our three cards that will form each screen of our wizard. The first contains three form fields...