1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
\r
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
\r
5 <title>Hello World Dialog Example</title>
\r
6 <link rel="stylesheet" type="text/css" href="../../css/roojs-debug.css"/>
7 <link rel="stylesheet" type="text/css" href="../../css/xtheme-slate.css"/>
9 <script type="text/javascript" src="../../roojs-debug.js"></script>
11 <script language="javascript" src="hello.js"></script>
\r
13 <!-- Common Styles for the examples -->
\r
14 <link rel="stylesheet" type="text/css" href="../examples.css" />
\r
17 <script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
\r
19 <h1>Hello World Dialog</h1>
\r
20 <p>This example shows how to create a very simple modal BasicDialog with "autoTabs".</p>
\r
21 <input type="button" id="show-dialog-btn" value="Hello World" /><br /><br />
\r
22 <p>Note that the js is not minified so it is readable. See
23 <button type="button" onclick="RooDocs.viewSource.show('/hello.js')">hello.js</button>for the full source code.</p>
\r
24 Here's snapshot of the code that creates the dialog:
\r
25 <pre class="code"><code>Roo.BLANK_IMAGE_URL = "../../images/default/s.gif";
34 show : function(data, cb)
36 // standard code example..
43 this.dialog.show(data._el ? data._el : false);
46 this.form.setValues(data);
47 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
55 this.dialog = Roo.factory({
57 xtype : 'LayoutDialog',
67 var p = this.layout.getRegion('center').getPanel(0);
68 p.setContent("Hello World");
71 keydown : function(dlg, e) {
73 if(k == 27){ _this.dialog.hide(); }
77 xtype: 'LayoutRegion',
82 xtype: 'ContentPanel',
104 click : function () {
117 // using onDocumentReady instead of window.onload initializes the application
118 // when the DOM is ready, without waiting for images and other resources to load
119 Roo.onReady(function() {
121 Roo.get('show-dialog-btn').on('click',function () {
122 HelloWorld.show({ _el : this});
127 <!-- The dialog is created from existing markup.
\r
128 The inline styles just hide it until it created and should be in a stylesheet -->
\r
129 <div id="hello-dlg" style="visibility:hidden;position:absolute;top:0px;">
\r
130 <div class="x-dlg-hd">Hello Dialog</div>
\r
131 <div class="x-dlg-bd">
\r
132 <!-- Auto create tab 1 -->
\r
133 <div class="x-dlg-tab" title="Hello World 1">
\r
134 <!-- Nested "inner-tab" to safely add padding -->
\r
135 <div class="inner-tab">
\r
136 Hello...<br><br><br>
\r
139 <!-- Auto create tab 2 -->
\r
140 <div class="x-dlg-tab" title="Hello World 2">
\r
141 <div class="inner-tab">
\r