3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
15 Ext.require(['Ext.panel.Panel', 'Ext.layout.container.Table']);
17 Ext.onReady(function() {
18 //Create the spotlight component
19 var spot = Ext.create('Ext.ux.Spotlight', {
24 //Create a DemoPanel which is the base for each panel in the example
25 Ext.define('DemoPanel', {
26 extend: 'Ext.panel.Panel',
32 html: 'Some panel content goes here!',
33 bodyStyle: 'padding:5px;',
36 * Custom method which toggles a Ext.Button for the current panel on/off depending on the only argument
38 toggle: function(on) {
39 var btns = this.dockedItems.last(),
40 btn = btns.items.first();
51 * Method which changes the spotlight to be active on a spefied panel
53 var updateSpot = function(id) {
54 if (typeof id == 'string') {
56 } else if (!id && spot.active) {
60 p1.toggle(id == p1.id);
61 p2.toggle(id == p2.id);
62 p3.toggle(id == p3.id);
65 Ext.createWidget('panel', {
66 renderTo: Ext.getBody(),
77 p1 = Ext.create('DemoPanel', {
86 }), p2 = Ext.create('DemoPanel', {
95 }), p3 = Ext.create('DemoPanel', {
100 handler: function() {
107 //The start button, which starts everything
108 Ext.create('Ext.button.Button', {
110 renderTo: 'start-ct',
111 handler: function() {
112 updateSpot('panel1');