Ext.Loader.setConfig({
enabled: true,
disableCaching: false,
paths: {
"Ext.ux": "../../../../../../../ExtJS/ExtJS4/ExtJS4.1.1a/examples/ux"
}
});
Ext.require([
"Ext.ux.data.PagingMemoryProxy"
]);
Ext.define("TestModel", {
extend: "Ext.data.Model",
idProperty: "id",
fields: [
{ name: "id", type: "int" },
{ name: "name", type: "string" }
]
});
Ext.onReady(function() {
var
maxRecordsCount = 50000,
pageSize = 150,
createData = function(max) {
var
data = [];
for(var i=0; i<max; ++i)
data.push( [ i, "Record# "+i ] );
return data;
},
data = createData(maxRecordsCount),
store = Ext.create("Ext.data.ArrayStore", {
model: "TestModel",
pageSize: pageSize,
proxy: {
type: "pagingmemory",
reader: {
type: "array"
}
//, data: data // need store.load() || store.loadPage()
}
//, data: data // store loads data automatically
}),
grid = Ext.create("Ext.grid.Panel", {
store: store,
columns: [
{ dataIndex: "id", header: "id" },
{ dataIndex: "name", header: "name" }
],
selModel: {
pruneRemoved: false
},
multiSelect: true,
viewConfig: {
trackOver: false
},
dockedItems: [{
xtype: "pagingtoolbar",
dock: "bottom",
store: store,
displayInfo: true
}]
});
Ext.create("Ext.window.Window", {
autoShow: true,
layout: "fit",
height: 400,
width: 1100,
maximizable: true,
items: [grid]
});
store.getProxy().data = data;
store.load();
//store.loadPage(1);
});
P.S. Если Вы посмотрите исходники Ext.ux.data.PagingMemoryProxy (ExtJS/examples/ux/data/PagingMemoryProxy.js), то Вы увидите, что PagingMemoryProxy хранит
ВСЕ данные в себе.