JavaScript
Run Code
Open in Fiddle
const container = new Ext.Container({ width: 500, height: 400, renderTo: Ext.getBody(), layout: 'card', activeItem: 1, bodyPadding: 15, items: [ { html: '<h2>Card 1</h2><p>Hello!</p>' }, { html: '<p>Card 2</p><p>Destroy Me</p>', tbar: [{ text: 'Destroy Card', handler: function () { this.up('panel').destroy(); // this will make card 0 active container.setActiveItem(0); } }] } ] });