3 * Copyright(c) 2006-2011 Sencha Inc.
5 * http://www.sencha.com/license
8 Ext.define('MyDesktop.AccordionWindow', {
9 extend: 'Ext.ux.desktop.Module',
13 'Ext.layout.container.Accordion',
22 text: 'Accordion Window',
24 handler : this.createWindow,
29 createTree : function(){
30 var tree = Ext.create('Ext.tree.Panel', {
32 title: 'Online Users',
38 handler: function(c, t) {
39 tree.setLoading(true, tree.body);
40 var root = tree.getRootNode();
41 root.collapseChildren(true, false);
42 Ext.Function.defer(function() { // mimic a server call
43 tree.setLoading(false);
44 root.expand(true, true);
48 store: Ext.create('Ext.data.TreeStore', {
56 { text:'Brian', iconCls:'user', leaf:true },
57 { text:'Kevin', iconCls:'user', leaf:true },
58 { text:'Mark', iconCls:'user', leaf:true },
59 { text:'Matt', iconCls:'user', leaf:true },
60 { text:'Michael', iconCls:'user', leaf:true },
61 { text:'Mike Jr', iconCls:'user', leaf:true },
62 { text:'Mike Sr', iconCls:'user', leaf:true },
63 { text:'JR', iconCls:'user', leaf:true },
64 { text:'Rich', iconCls:'user', leaf:true },
65 { text:'Nige', iconCls:'user', leaf:true },
66 { text:'Zac', iconCls:'user', leaf:true }
72 { text:'Kiana', iconCls:'user-girl', leaf:true },
73 { text:'Aubrey', iconCls:'user-girl', leaf:true },
74 { text:'Cale', iconCls:'user-kid', leaf:true }
84 createWindow : function(){
85 var desktop = this.app.getDesktop();
86 var win = desktop.getWindow('acc-win');
89 win = desktop.createWindow({
91 title: 'Accordion Window',
96 constrainHeader: true,
102 tooltip:{title:'Rich Tooltips', text:'Let your users know what they can do!'},
107 tooltip:'Add a new user',
112 tooltip:'Remove the selected user',
113 iconCls:'user-delete'
124 html:'<p>Something useful would be in here.</p>',
128 title: 'Even More Stuff',
129 html : '<p>Something useful would be in here.</p>'
133 html : '<p>Something useful would be in here.</p>'