]> source.dussan.org Git - jquery-ui.git/commitdiff
Functional demos: init autocomplete
authorChi Cheng <cloudream@gmail.com>
Fri, 8 Aug 2008 06:58:56 +0000 (06:58 +0000)
committerChi Cheng <cloudream@gmail.com>
Fri, 8 Aug 2008 06:58:56 +0000 (06:58 +0000)
demos/functional/templates/ui.autocomplete.html [new file with mode: 0644]

diff --git a/demos/functional/templates/ui.autocomplete.html b/demos/functional/templates/ui.autocomplete.html
new file mode 100644 (file)
index 0000000..fc34fb5
--- /dev/null
@@ -0,0 +1,32 @@
+<script type="text/javascript">\r
+\r
+       var autocomplete_data = '["book","movie","music","sports","skating","swim"]';\r
+\r
+       var model = {\r
+               \r
+               renderAt: '#containerDemo',\r
+\r
+               title: 'Autocomplete Demos',\r
+               \r
+               demos: [\r
+\r
+                       {\r
+                               title: 'Simple autocomplete',\r
+                               desc: 'With few lines of code you could build a autocomplete. You can try more options on the fly! ',\r
+                               html: '<input id="autocomplete" type="text" /> (Try type <em>m</em> or <em>s</em>)',\r
+                               destroy: '$("#autocomplete").autocomplete("destroy");',\r
+                               options: [\r
+                                       { desc: 'Attach a autocomplete', source: '$("#autocomplete").autocomplete({data:'+autocomplete_data+'});' }\r
+                               ]\r
+                       }\r
+\r
+               ]\r
+       };\r
+\r
+       $(function(){\r
+\r
+               uiRenderDemo(model);\r
+\r
+       });\r
+\r
+</script>
\ No newline at end of file