This recipe describes how to use a card layout as a container layout. Card layout lays items in the form of (playing) cards and shows only one item at a time. We will implement a wizard application to understand the usage of this layout.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
Carry out the following steps:
Create and open a new file named
ch03_04.js
and paste the following code into it:Ext.setup({ onReady: function() { var navigate = function(panel, direction){ var layout = panel.getLayout(); layout[direction](); Ext.getCmp('move-prev').setDisabled(!layout.getPrev()); Ext.getCmp('move-next').setDisabled(!layout.getNext()); }; var pnl = new Ext.Panel({ title: 'Wizard', fullscreen: true, layout: 'card', bodyStyle: 'padding:15px', defaults: { border: false }, dockedItems: [...