1 Ext.require(['Ext.panel.Panel', 'Ext.layout.container.Table']);
3 Ext.onReady(function() {
4 //Create the spotlight component
5 var spot = Ext.create('Ext.ux.Spotlight', {
10 //Create a DemoPanel which is the base for each panel in the example
11 Ext.define('DemoPanel', {
12 extend: 'Ext.panel.Panel',
18 html: 'Some panel content goes here!',
19 bodyStyle: 'padding:5px;',
22 * Custom method which toggles a Ext.Button for the current panel on/off depending on the only argument
24 toggle: function(on) {
25 var btns = this.dockedItems.items[1],
26 btn = btns.items.items[1];
37 * Method which changes the spotlight to be active on a spefied panel
39 var updateSpot = function(id) {
40 if (typeof id == 'string') {
42 } else if (!id && spot.active) {
46 p1.toggle(id == p1.id);
47 p2.toggle(id == p2.id);
48 p3.toggle(id == p3.id);
51 Ext.createWidget('panel', {
52 renderTo: Ext.getBody(),
63 p1 = Ext.create('DemoPanel', {
72 }), p2 = Ext.create('DemoPanel', {
81 }), p3 = Ext.create('DemoPanel', {
93 //The start button, which starts everything
94 Ext.create('Ext.button.Button', {