Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / examples / form / forum-search.js
index 3a37fc3..4d94cda 100644 (file)
@@ -1,52 +1,50 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-Ext.onReady(function(){\r
-\r
-    var ds = new Ext.data.Store({\r
-        proxy: new Ext.data.ScriptTagProxy({\r
-            url: 'http://extjs.com/forum/topics-remote.php'\r
-        }),\r
-        reader: new Ext.data.JsonReader({\r
-            root: 'topics',\r
-            totalProperty: 'totalCount',\r
-            id: 'post_id'\r
-        }, [\r
-            {name: 'title', mapping: 'topic_title'},\r
-            {name: 'topicId', mapping: 'topic_id'},\r
-            {name: 'author', mapping: 'author'},\r
-            {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},\r
-            {name: 'excerpt', mapping: 'post_text'}\r
-        ])\r
-    });\r
-\r
-    // Custom rendering Template\r
-    var resultTpl = new Ext.XTemplate(\r
-        '<tpl for="."><div class="search-item">',\r
-            '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>{title}</h3>',\r
-            '{excerpt}',\r
-        '</div></tpl>'\r
-    );\r
-    \r
-    var search = new Ext.form.ComboBox({\r
-        store: ds,\r
-        displayField:'title',\r
-        typeAhead: false,\r
-        loadingText: 'Searching...',\r
-        width: 570,\r
-        pageSize:10,\r
-        hideTrigger:true,\r
-        tpl: resultTpl,\r
-        applyTo: 'search',\r
-        itemSelector: 'div.search-item',\r
-        onSelect: function(record){ // override default onSelect to do redirect\r
-            window.location =\r
-                String.format('http://extjs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);\r
-        }\r
-    });\r
+/*!
+ * Ext JS Library 3.0.0
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+Ext.onReady(function(){
+
+    var ds = new Ext.data.Store({
+        proxy: new Ext.data.ScriptTagProxy({
+            url: 'http://extjs.com/forum/topics-remote.php'
+        }),
+        reader: new Ext.data.JsonReader({
+            root: 'topics',
+            totalProperty: 'totalCount',
+            id: 'post_id'
+        }, [
+            {name: 'title', mapping: 'topic_title'},
+            {name: 'topicId', mapping: 'topic_id'},
+            {name: 'author', mapping: 'author'},
+            {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
+            {name: 'excerpt', mapping: 'post_text'}
+        ])
+    });
+
+    // Custom rendering Template
+    var resultTpl = new Ext.XTemplate(
+        '<tpl for="."><div class="search-item">',
+            '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>{title}</h3>',
+            '{excerpt}',
+        '</div></tpl>'
+    );
+    
+    var search = new Ext.form.ComboBox({
+        store: ds,
+        displayField:'title',
+        typeAhead: false,
+        loadingText: 'Searching...',
+        width: 570,
+        pageSize:10,
+        hideTrigger:true,
+        tpl: resultTpl,
+        applyTo: 'search',
+        itemSelector: 'div.search-item',
+        onSelect: function(record){ // override default onSelect to do redirect
+            window.location =
+                String.format('http://extjs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);
+        }
+    });
 });
\ No newline at end of file