X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/docs/source/custom1.html diff --git a/docs/source/custom1.html b/docs/source/custom1.html new file mode 100644 index 00000000..855107fa --- /dev/null +++ b/docs/source/custom1.html @@ -0,0 +1,72 @@ + +
+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: 'postId', mapping: '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'} + ]), + + baseParams: {limit:20, forumId: 4} + }); + + // Custom rendering Template for the View + var resultTpl = new Ext.XTemplate( + '+ + \ No newline at end of file', + ' ' + ); + + var panel = new Ext.Panel({ + applyTo: 'search-panel', + title:'Forum Search', + height:300, + autoScroll:true, + + items: new Ext.DataView({ + tpl: resultTpl, + store: ds, + itemSelector: 'div.search-item' + }), + + tbar: [ + 'Search: ', ' ', + new Ext.ux.form.SearchField({ + store: ds, + width:320 + }) + ], + + bbar: new Ext.PagingToolbar({ + store: ds, + pageSize: 20, + displayInfo: true, + displayMsg: 'Topics {0} - {1} of {2}', + emptyMsg: "No topics to display" + }) + }); + + ds.load({params:{start:0, limit:20, forumId: 4}}); +}); +', + '{lastPost:date("M j, Y")}
', + '
by {author}', + '{title}{excerpt}
', + '