4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
13 Roo.onReady(function(){
15 var ds = new Roo.data.Store({
19 proxy: new Roo.data.ScriptTagProxy({
20 url: 'http://www.roojs.com/forum/topics-remote.php'
22 reader: new Roo.data.JsonReader({
24 totalProperty: 'totalCount',
27 {name: 'title', mapping: 'topic_title'},
28 {name: 'topicId', mapping: 'topic_id'},
29 {name: 'author', mapping: 'author'},
30 {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
31 {name: 'excerpt', mapping: 'post_text'}
36 // Custom rendering Template
37 var resultTpl = new Roo.Template(
38 '<div class="search-item">',
39 '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>{title}</h3>',
44 var search = new Roo.form.ComboBox({
48 loadingText: 'Searching...',
53 onSelect: function(record){ // override default onSelect to do redirect
55 String.format('http://www.roojs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);
58 // apply it to the exsting input element
59 search.applyTo('search');