X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/form/forum-search.js
diff --git a/examples/form/forum-search.js b/examples/form/forum-search.js
index 64adae30..eaaefc4b 100644
--- a/examples/form/forum-search.js
+++ b/examples/form/forum-search.js
@@ -1,50 +1,82 @@
-/*!
- * Ext JS Library 3.1.1
- * Copyright(c) 2006-2010 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
+Ext.require([
+ 'Ext.data.*',
+ 'Ext.form.*'
+]);
+
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'
- }, [
+ Ext.define("Post", {
+ extend: 'Ext.data.Model',
+ proxy: {
+ type: 'jsonp',
+ url : 'http://www.sencha.com/forum/topics-remote.php',
+ reader: {
+ type: 'json',
+ root: 'topics',
+ totalProperty: 'totalCount'
+ }
+ },
+
+ fields: [
+ {name: 'id', 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'}
- ])
+ ]
});
- // Custom rendering Template
- var resultTpl = new Ext.XTemplate(
- '{lastPost:date("M j, Y")}
',
- '{excerpt}',
- '
by {author}{title}