2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
10 // This is the main layout definition.
\r
12 Ext.onReady(function(){
\r
14 Ext.QuickTips.init();
\r
16 // This is an inner body element within the Details panel created to provide a "slide in" effect
\r
17 // on the panel body without affecting the body's box itself. This element is created on
\r
18 // initial use and cached in this var for subsequent access.
\r
21 // This is the main content center region that will contain each example layout panel.
\r
22 // It will be implemented as a CardLayout since it will contain multiple panels with
\r
23 // only one being visible at any given time.
\r
24 var contentPanel = {
\r
25 id: 'content-panel',
\r
26 region: 'center', // this is what makes this panel into a region within the containing layout
\r
33 start, absolute, accordion, anchor, border, cardTabs, cardWizard, column, fit, form, table,
\r
35 rowLayout, centerLayout,
\r
36 // from combination.js:
\r
37 absoluteForm, tabsNestedLayouts
\r
41 // Go ahead and create the TreePanel now so that we can use it below
\r
42 var treePanel = new Ext.tree.TreePanel({
\r
44 title: 'Sample Layouts',
\r
51 // tree-specific configs:
\r
57 loader: new Ext.tree.TreeLoader({
\r
58 dataUrl:'tree-data.json'
\r
61 root: new Ext.tree.AsyncTreeNode()
\r
64 // Assign the changeLayout function to be called on tree node click.
\r
65 treePanel.on('click', function(n){
\r
66 var sn = this.selModel.selNode || {}; // selNode is null on initial selection
\r
67 if(n.leaf && n.id != sn.id){ // ignore clicks on folders and currently selected node
\r
68 Ext.getCmp('content-panel').layout.setActiveItem(n.id + '-panel');
\r
70 var bd = Ext.getCmp('details-panel').body;
\r
71 bd.update('').setStyle('background','#fff');
\r
72 detailEl = bd.createChild(); //create default empty div
\r
74 detailEl.hide().update(Ext.getDom(n.id+'-details').innerHTML).slideIn('l', {stopFx:true,duration:.2});
\r
78 // This is the Details panel that contains the description for each example layout.
\r
79 var detailsPanel = {
\r
80 id: 'details-panel',
\r
83 bodyStyle: 'padding-bottom:15px;background:#eee;',
\r
85 html: '<p class="details-info">When you select a layout from the tree, additional details will display here.</p>'
\r
88 // Finally, build the main layout once all the pieces are ready. This is also a good
\r
89 // example of putting together a full-screen BorderLayout within a Viewport.
\r
92 title: 'Ext Layout Browser',
\r
100 id: 'layout-browser',
\r
104 margins: '2 0 5 5',
\r
108 items: [treePanel, detailsPanel]
\r
112 renderTo: Ext.getBody()
\r