Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / examples / grid / buffer-grid.js
index 4a4cb65..62b9813 100644 (file)
@@ -1,3 +1,17 @@
+/*
+
+This file is part of Ext JS 4
+
+Copyright (c) 2011 Sencha Inc
+
+Contact:  http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
+
+*/
 Ext.Loader.setConfig({enabled: true});
 
 Ext.Loader.setPath('Ext.ux', '../ux/');
@@ -8,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
@@ -39,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',
@@ -58,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'
         }
@@ -112,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);
 
@@ -120,3 +132,4 @@ Ext.onReady(function(){
 });
 
 
+