Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / chooser-example.html
diff --git a/docs/source/chooser-example.html b/docs/source/chooser-example.html
new file mode 100644 (file)
index 0000000..ae266e0
--- /dev/null
@@ -0,0 +1,37 @@
+<html>\r
+<head>\r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js">Ext.onReady(function(){\r
+    var chooser, btn;\r
+\r
+    function insertImage(data){\r
+       Ext.DomHelper.append('images', {\r
+               tag: 'img', src: data.url, style:'margin:10px;visibility:hidden;'\r
+       }, true).show(true).frame();\r
+       btn.focus();\r
+    };\r
+\r
+    function choose(btn){\r
+       if(!chooser){\r
+               chooser = new ImageChooser({\r
+                       url:'get-images.php',\r
+                       width:515,\r
+                       height:350\r
+               });\r
+       }\r
+       chooser.show(btn.getEl(), insertImage);\r
+    };\r
+\r
+    btn = new Ext.Button({\r
+           text: "Insert Image",\r
+               handler: choose,\r
+        renderTo: 'buttons'\r
+    });\r
+});\r
+</pre>    \r
+</body>\r
+</html>
\ No newline at end of file