3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 // Sample desktop configuration
\r
9 MyDesktop = new Ext.app.App({
\r
11 Ext.QuickTips.init();
\r
14 getModules : function(){
\r
16 new MyDesktop.GridWindow(),
\r
17 new MyDesktop.TabWindow(),
\r
18 new MyDesktop.AccordionWindow(),
\r
19 new MyDesktop.BogusMenuModule(),
\r
20 new MyDesktop.BogusModule()
\r
24 // config for the start menu
\r
25 getStartConfig : function(){
\r
27 title: 'Jack Slocum',
\r
47 MyDesktop.GridWindow = Ext.extend(Ext.app.Module, {
\r
51 text: 'Grid Window',
\r
52 iconCls:'icon-grid',
\r
53 handler : this.createWindow,
\r
58 createWindow : function(){
\r
59 var desktop = this.app.getDesktop();
\r
60 var win = desktop.getWindow('grid-win');
\r
62 win = desktop.createWindow({
\r
64 title:'Grid Window',
\r
67 iconCls: 'icon-grid',
\r
70 constrainHeader:true,
\r
74 new Ext.grid.GridPanel({
\r
76 ds: new Ext.data.Store({
\r
77 reader: new Ext.data.ArrayReader({}, [
\r
79 {name: 'price', type: 'float'},
\r
80 {name: 'change', type: 'float'},
\r
81 {name: 'pctChange', type: 'float'}
\r
83 data: Ext.grid.dummyData
\r
85 cm: new Ext.grid.ColumnModel([
\r
86 new Ext.grid.RowNumberer(),
\r
87 {header: "Company", width: 120, sortable: true, dataIndex: 'company'},
\r
88 {header: "Price", width: 70, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
\r
89 {header: "Change", width: 70, sortable: true, dataIndex: 'change'},
\r
90 {header: "% Change", width: 70, sortable: true, dataIndex: 'pctChange'}
\r
96 //autoExpandColumn:'company',
\r
99 text:'Add Something',
\r
100 tooltip:'Add a new row',
\r
104 tooltip:'Blah blah blah blaht',
\r
107 text:'Remove Something',
\r
108 tooltip:'Remove the selected item',
\r
120 MyDesktop.TabWindow = Ext.extend(Ext.app.Module, {
\r
124 text: 'Tab Window',
\r
126 handler : this.createWindow,
\r
131 createWindow : function(){
\r
132 var desktop = this.app.getDesktop();
\r
133 var win = desktop.getWindow('tab-win');
\r
135 win = desktop.createWindow({
\r
137 title:'Tab Window',
\r
142 animCollapse:false,
\r
144 constrainHeader:true,
\r
152 title: 'Tab Text 1',
\r
154 html : '<p>Something useful would be in here.</p>',
\r
157 title: 'Tab Text 2',
\r
159 html : '<p>Something useful would be in here.</p>',
\r
162 title: 'Tab Text 3',
\r
164 html : '<p>Something useful would be in here.</p>',
\r
167 title: 'Tab Text 4',
\r
169 html : '<p>Something useful would be in here.</p>',
\r
181 MyDesktop.AccordionWindow = Ext.extend(Ext.app.Module, {
\r
185 text: 'Accordion Window',
\r
186 iconCls:'accordion',
\r
187 handler : this.createWindow,
\r
192 createWindow : function(){
\r
193 var desktop = this.app.getDesktop();
\r
194 var win = desktop.getWindow('acc-win');
\r
196 win = desktop.createWindow({
\r
198 title: 'Accordion Window',
\r
201 iconCls: 'accordion',
\r
203 animCollapse:false,
\r
204 constrainHeader:true,
\r
207 tooltip:{title:'Rich Tooltips', text:'Let your users know what they can do!'},
\r
210 tooltip:'Add a new user',
\r
213 tooltip:'Remove the selected user',
\r
214 iconCls:'user-delete'
\r
217 layout:'accordion',
\r
224 new Ext.tree.TreePanel({
\r
226 title: 'Online Users',
\r
227 loader: new Ext.tree.TreeLoader(),
\r
235 var tree = Ext.getCmp('im-tree');
\r
236 tree.body.mask('Loading', 'x-mask-loading');
\r
237 tree.root.reload();
\r
238 tree.root.collapse(true, false);
\r
239 setTimeout(function(){ // mimic a server call
\r
240 tree.body.unmask();
\r
241 tree.root.expand(true, true);
\r
246 root: new Ext.tree.AsyncTreeNode({
\r
285 iconCls:'user-girl',
\r
289 iconCls:'user-girl',
\r
293 iconCls:'user-kid',
\r
297 iconCls:'user-kid',
\r
304 html:'<p>Something useful would be in here.</p>',
\r
307 title: 'Even More Stuff',
\r
308 html : '<p>Something useful would be in here.</p>'
\r
311 html : '<p>Something useful would be in here.</p>'
\r
320 // for example purposes
\r
321 var windowIndex = 0;
\r
323 MyDesktop.BogusModule = Ext.extend(Ext.app.Module, {
\r
326 text: 'Window '+(++windowIndex),
\r
328 handler : this.createWindow,
\r
330 windowId:windowIndex
\r
334 createWindow : function(src){
\r
335 var desktop = this.app.getDesktop();
\r
336 var win = desktop.getWindow('bogus'+src.windowId);
\r
338 win = desktop.createWindow({
\r
339 id: 'bogus'+src.windowId,
\r
343 html : '<p>Something useful would be in here.</p>',
\r
346 animCollapse:false,
\r
347 constrainHeader:true
\r
355 MyDesktop.BogusMenuModule = Ext.extend(MyDesktop.BogusModule, {
\r
358 text: 'Bogus Submenu',
\r
360 handler: function() {
\r
365 text: 'Bogus Window '+(++windowIndex),
\r
367 handler : this.createWindow,
\r
369 windowId: windowIndex
\r
371 text: 'Bogus Window '+(++windowIndex),
\r
373 handler : this.createWindow,
\r
375 windowId: windowIndex
\r
377 text: 'Bogus Window '+(++windowIndex),
\r
379 handler : this.createWindow,
\r
381 windowId: windowIndex
\r
383 text: 'Bogus Window '+(++windowIndex),
\r
385 handler : this.createWindow,
\r
387 windowId: windowIndex
\r
389 text: 'Bogus Window '+(++windowIndex),
\r
391 handler : this.createWindow,
\r
393 windowId: windowIndex
\r
401 // Array data for the grid
\r
402 Ext.grid.dummyData = [
\r
403 ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
\r
404 ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
\r
405 ['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],
\r
406 ['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],
\r
407 ['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],
\r
408 ['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],
\r
409 ['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],
\r
410 ['Exxon Mobil Corp',68.1,-0.43,-0.64,'9/1 12:00am'],
\r
411 ['General Electric Company',34.14,-0.08,-0.23,'9/1 12:00am'],
\r
412 ['General Motors Corporation',30.27,1.09,3.74,'9/1 12:00am'],
\r
413 ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
\r
414 ['Honeywell Intl Inc',38.77,0.05,0.13,'9/1 12:00am'],
\r
415 ['Intel Corporation',19.88,0.31,1.58,'9/1 12:00am'],
\r
416 ['Johnson & Johnson',64.72,0.06,0.09,'9/1 12:00am'],
\r
417 ['Merck & Co., Inc.',40.96,0.41,1.01,'9/1 12:00am'],
\r
418 ['Microsoft Corporation',25.84,0.14,0.54,'9/1 12:00am'],
\r
419 ['The Coca-Cola Company',45.07,0.26,0.58,'9/1 12:00am'],
\r
420 ['The Procter & Gamble Company',61.91,0.01,0.02,'9/1 12:00am'],
\r
421 ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am'],
\r
422 ['Walt Disney Company (The) (Holding Company)',29.89,0.24,0.81,'9/1 12:00am']
\r