X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/d41dc04ad17d1d9125fb2cf72db2b4782dbe3a8c..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/examples/form/forum-search.js?ds=sidebyside diff --git a/examples/form/forum-search.js b/examples/form/forum-search.js index 3a37fc3e..11f0a656 100644 --- a/examples/form/forum-search.js +++ b/examples/form/forum-search.js @@ -1,52 +1,50 @@ -/* - * Ext JS Library 2.2.1 - * Copyright(c) 2006-2009, Ext JS, LLC. - * licensing@extjs.com - * - * http://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( - '
', - '

{lastPost:date("M j, Y")}
by {author}
{title}

', - '{excerpt}', - '
' - ); - - 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); - } - }); +/*! + * Ext JS Library 3.0.3 + * 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( + '
', + '

{lastPost:date("M j, Y")}
by {author}
{title}

', + '{excerpt}', + '
' + ); + + 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