X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..530ef4b6c5b943cfa68b779d11cf7de29aa878bf:/examples/grid/buffer.js?ds=inline diff --git a/examples/grid/buffer.js b/examples/grid/buffer.js index 896f7821..25683ed9 100644 --- a/examples/grid/buffer.js +++ b/examples/grid/buffer.js @@ -1,89 +1,89 @@ /*! - * 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(){ - - 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( - '{0}{1} Forum', - value, record.data.forumtitle, record.id, record.data.forumid); - } - function renderLast(value, p, r){ - return String.format('{0}
by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']); - } - -}); +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( + '{0}{1} Forum', + value, record.data.forumtitle, record.id, record.data.forumid); + } + function renderLast(value, p, r){ + return String.format('{0}
by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']); + } + +});