1 Ext.Loader.setConfig({enabled: true});
3 Ext.Loader.setPath('Ext.ux', '../ux');
6 'Ext.tip.QuickTipManager',
7 'Ext.container.Viewport',
16 'Ext.ux.layout.Center'
20 // This is the main layout definition.
22 Ext.onReady(function(){
24 Ext.tip.QuickTipManager.init();
26 // This is an inner body element within the Details panel created to provide a "slide in" effect
27 // on the panel body without affecting the body's box itself. This element is created on
28 // initial use and cached in this var for subsequent access.
31 // Gets all layouts examples
32 var layoutExamples = [];
33 Ext.Object.each(getBasicLayouts(), function(name, example) {
34 layoutExamples.push(example);
37 Ext.Object.each(getCombinationLayouts(), function(name, example){
38 layoutExamples.push(example);
41 Ext.Object.each(getCustomLayouts(), function(name, example){
42 layoutExamples.push(example);
45 // This is the main content center region that will contain each example layout panel.
46 // It will be implemented as a CardLayout since it will contain multiple panels with
47 // only one being visible at any given time.
51 region: 'center', // this is what makes this panel into a region within the containing layout
59 var store = Ext.create('Ext.data.TreeStore', {
69 // Go ahead and create the TreePanel now so that we can use it below
70 var treePanel = Ext.create('Ext.tree.Panel', {
72 title: 'Sample Layouts',
82 // Assign the changeLayout function to be called on tree node click.
83 treePanel.getSelectionModel().on('select', function(selModel, record) {
84 if (record.get('leaf')) {
85 Ext.getCmp('content-panel').layout.setActiveItem(record.getId() + '-panel');
87 var bd = Ext.getCmp('details-panel').body;
88 bd.update('').setStyle('background','#fff');
89 detailEl = bd.createChild(); //create default empty div
91 detailEl.hide().update(Ext.getDom(record.getId() + '-details').innerHTML).slideIn('l', {stopAnimation:true,duration: 200});
95 // This is the Details panel that contains the description for each example layout.
100 bodyStyle: 'padding-bottom:15px;background:#eee;',
102 html: '<p class="details-info">When you select a layout from the tree, additional details will display here.</p>'
105 // Finally, build the main layout once all the pieces are ready. This is also a good
106 // example of putting together a full-screen BorderLayout within a Viewport.
107 Ext.create('Ext.Viewport', {
109 title: 'Ext Layout Browser',
114 html: '<h1> Ext.Layout.Browser</h1>',
118 id: 'layout-browser',
126 items: [treePanel, detailsPanel]
130 renderTo: Ext.getBody()