/*!
- * Ext JS Library 3.1.1
- * Copyright(c) 2006-2010 Ext JS, LLC
+ * Ext JS Library 3.2.1
+ * Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
-Ext.onReady(function(){\r
-\r
- var store = new Ext.data.Store({\r
- remoteSort: true,\r
- baseParams: {lightWeight:true,ext: 'js'},\r
- sortInfo: {field:'lastpost', direction:'DESC'},\r
- autoLoad: {params:{start:0, limit:500}},\r
-\r
- proxy: new Ext.data.ScriptTagProxy({\r
- url: 'http://extjs.com/forum/topics-browse-remote.php'\r
- }),\r
-\r
- reader: new Ext.data.JsonReader({\r
- root: 'topics',\r
- totalProperty: 'totalCount',\r
- idProperty: 'threadid',\r
- fields: [\r
- 'title', 'forumtitle', 'forumid', 'author',\r
- {name: 'replycount', type: 'int'},\r
- {name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp'},\r
- 'lastposter', 'excerpt'\r
- ]\r
- })\r
- });\r
-\r
- var grid = new Ext.grid.GridPanel({\r
- renderTo: 'topic-grid',\r
- width:700,\r
- height:500,\r
- frame:true,\r
- title:'ExtJS.com - Browse Forums',\r
- trackMouseOver:false,\r
- autoExpandColumn: 'topic',\r
- store: store,\r
-\r
- columns: [new Ext.grid.RowNumberer({width: 30}),{\r
- id: 'topic',\r
- header: "Topic",\r
- dataIndex: 'title',\r
- width: 420,\r
- renderer: renderTopic,\r
- sortable:true\r
- },{\r
- header: "Replies",\r
- dataIndex: 'replycount',\r
- width: 70,\r
- align: 'right',\r
- sortable:true\r
- },{\r
- id: 'last',\r
- header: "Last Post",\r
- dataIndex: 'lastpost',\r
- width: 150,\r
- renderer: renderLast,\r
- sortable:true\r
- }],\r
-\r
- bbar: new Ext.PagingToolbar({\r
- store: store,\r
- pageSize:500,\r
- displayInfo:true\r
- }),\r
-\r
- view: new Ext.ux.grid.BufferView({\r
- // custom row height\r
- rowHeight: 34,\r
- // render rows as they come into viewable area.\r
- scrollDelay: false\r
- })\r
- });\r
-\r
-\r
- // render functions\r
- function renderTopic(value, p, record){\r
- return String.format(\r
- '<b><a href="http://extjs.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b><a href="http://extjs.com/forum/forumdisplay.php?f={3}" target="_blank">{1} Forum</a>',\r
- value, record.data.forumtitle, record.id, record.data.forumid);\r
- }\r
- function renderLast(value, p, r){\r
- return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']);\r
- }\r
-\r
-});\r
+Ext.onReady(function(){
+
+ var store = new Ext.data.Store({
+ remoteSort: true,
+ baseParams: {lightWeight:true,ext: 'js'},
+ sortInfo: {field:'lastpost', direction:'DESC'},
+ autoLoad: {params:{start:0, limit:500}},
+
+ proxy: new Ext.data.ScriptTagProxy({
+ url: 'http://extjs.com/forum/topics-browse-remote.php'
+ }),
+
+ reader: new Ext.data.JsonReader({
+ root: 'topics',
+ totalProperty: 'totalCount',
+ idProperty: 'threadid',
+ fields: [
+ 'title', 'forumtitle', 'forumid', 'author',
+ {name: 'replycount', type: 'int'},
+ {name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp'},
+ 'lastposter', 'excerpt'
+ ]
+ })
+ });
+
+ var grid = new Ext.grid.GridPanel({
+ renderTo: 'topic-grid',
+ width:700,
+ height:500,
+ frame:true,
+ title:'ExtJS.com - Browse Forums',
+ trackMouseOver:false,
+ autoExpandColumn: 'topic',
+ store: store,
+
+ columns: [new Ext.grid.RowNumberer({width: 30}),{
+ id: 'topic',
+ header: "Topic",
+ dataIndex: 'title',
+ width: 420,
+ renderer: renderTopic,
+ sortable:true
+ },{
+ header: "Replies",
+ dataIndex: 'replycount',
+ width: 70,
+ align: 'right',
+ sortable:true
+ },{
+ id: 'last',
+ header: "Last Post",
+ dataIndex: 'lastpost',
+ width: 150,
+ renderer: renderLast,
+ sortable:true
+ }],
+
+ bbar: new Ext.PagingToolbar({
+ store: store,
+ pageSize:500,
+ displayInfo:true
+ }),
+
+ view: new Ext.ux.grid.BufferView({
+ // custom row height
+ rowHeight: 34,
+ // render rows as they come into viewable area.
+ scrollDelay: false
+ })
+ });
+
+
+ // render functions
+ function renderTopic(value, p, record){
+ return String.format(
+ '<b><a href="http://extjs.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b><a href="http://extjs.com/forum/forumdisplay.php?f={3}" target="_blank">{1} Forum</a>',
+ value, record.data.forumtitle, record.id, record.data.forumid);
+ }
+ function renderLast(value, p, r){
+ return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']);
+ }
+
+});