X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/examples/grid/buffer-grid.js diff --git a/examples/grid/buffer-grid.js b/examples/grid/buffer-grid.js index 95b948cf..62b98131 100644 --- a/examples/grid/buffer-grid.js +++ b/examples/grid/buffer-grid.js @@ -22,6 +22,15 @@ Ext.require([ 'Ext.grid.PagingScroller' ]); +Ext.define('Employee', { + extend: 'Ext.data.Model', + fields: [ + {name: 'rating', type: 'int'}, + {name: 'salary', type: 'float'}, + {name: 'name'} + ] +}); + Ext.onReady(function(){ /** * Returns an array of fake data @@ -53,17 +62,6 @@ Ext.onReady(function(){ } return data; } - - Ext.define('Employee', { - extend: 'Ext.data.Model', - fields: [ - {name: 'rating', type: 'int'}, - {name: 'salary', type: 'float'}, - {name: 'name'} - ] - }); - - // create the Data Store var store = Ext.create('Ext.data.Store', { id: 'store', @@ -72,7 +70,7 @@ Ext.onReady(function(){ buffered: true, // never purge any data, we prefetch all up front purgePageCount: 0, - model: 'ForumThread', + model: 'Employee', proxy: { type: 'memory' } @@ -126,7 +124,7 @@ Ext.onReady(function(){ records = [], i = 0; for (; i < ln; i++) { - records.push(Ext.ModelManager.create(data[i], 'Employee')); + records.push(Ext.create('Employee', data[i])); } store.cacheRecords(records);