3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
7 Ext.onReady(function(){
\r
8 var ds = new Ext.data.Store({
\r
9 proxy: new Ext.data.ScriptTagProxy({
\r
10 url: 'http://extjs.com/forum/topics-remote.php'
\r
12 reader: new Ext.data.JsonReader({
\r
14 totalProperty: 'totalCount',
\r
17 {name: 'postId', mapping: 'post_id'},
\r
18 {name: 'title', mapping: 'topic_title'},
\r
19 {name: 'topicId', mapping: 'topic_id'},
\r
20 {name: 'author', mapping: 'author'},
\r
21 {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
\r
22 {name: 'excerpt', mapping: 'post_text'}
\r
25 baseParams: {limit:20, forumId: 4}
\r
28 // Custom rendering Template for the View
\r
29 var resultTpl = new Ext.XTemplate(
\r
31 '<div class="search-item">',
\r
32 '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>',
\r
33 '<a href="http://extjs.com/forum/showthread.php?t={topicId}&p={postId}" target="_blank">{title}</a></h3>',
\r
38 var panel = new Ext.Panel({
\r
39 applyTo: 'search-panel',
\r
40 title:'Forum Search',
\r
44 items: new Ext.DataView({
\r
47 itemSelector: 'div.search-item'
\r
52 new Ext.ux.form.SearchField({
\r
58 bbar: new Ext.PagingToolbar({
\r
62 displayMsg: 'Topics {0} - {1} of {2}',
\r
63 emptyMsg: "No topics to display"
\r
67 ds.load({params:{start:0, limit:20, forumId: 4}});
\r