4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
11 Roo.BLANK_IMAGE_URL = "../../images/default/s.gif";
13 // create the LayoutExample application (single instance)
\r
14 var LayoutExample = function(){
\r
15 // everything in this space is private and only accessible in the HelloWorld block
\r
17 // define some private variables
\r
18 var dialog, showBtn;
\r
20 var toggleTheme = function(){
\r
21 Roo.get(document.body, true).toggleClass('xtheme-gray');
\r
23 // return a public interface
\r
26 showBtn = Roo.get('show-dialog-btn');
\r
27 // attach to click event
\r
28 showBtn.on('click', this.showDialog, this);
\r
32 showDialog : function(){
\r
33 if(!dialog){ // lazy initialize the dialog and only create it once
\r
34 dialog = new Roo.LayoutDialog("hello-dlg", {
\r
55 alwaysShowTabs: true
\r
58 dialog.addKeyListener(27, dialog.hide, dialog);
\r
59 dialog.addButton('Submit', dialog.hide, dialog);
\r
60 dialog.addButton('Close', dialog.hide, dialog);
\r
62 var layout = dialog.getLayout();
\r
63 layout.beginUpdate();
\r
64 layout.add('west', new Roo.ContentPanel('west', {title: 'West'}));
\r
65 layout.add('center', new Roo.ContentPanel('center', {title: 'The First Tab'}));
\r
66 // generate some other tabs
\r
67 layout.add('center', new Roo.ContentPanel(Roo.id(), {
\r
68 autoCreate:true, title: 'Another Tab', background:true}));
\r
69 layout.add('center', new Roo.ContentPanel(Roo.id(), {
\r
70 autoCreate:true, title: 'Third Tab', closable:true, background:true}));
\r
73 dialog.show(showBtn.dom);
\r
78 // using onDocumentReady instead of window.onload initializes the application
\r
79 // when the DOM is ready, without waiting for images and other resources to load
\r
80 Roo.EventManager.onDocumentReady(LayoutExample.init, LayoutExample, true);