How to get all data from a grid which have more than 1 page?
I set only to display 50 records in a page, but my total data is up to 52 records which store into 2 pages.
May i know how to get all data from this 2 pages?
Below is the code which only can get 1 page data...
ExportButtonTestJS = Ext.extend(One.Report, {
reportName: 'ExportButtonTestRpt',
autoExecute: true,
isDetailPage: false,
listeners: {
bbarconfig: function(report, bbarConfig) {
bbarConfig.items.push({
xtype: 'button',
text: 'Export',
disabled: false,
onClick : function () {
console.log(report.grid.getStore().data.items);
}
});
}
}
});
Default page size is 50 for Ext.data.store. So even the data in store is more than 50 records (like for example 400) only 50 records will be stored in a Ext.store at any time. Once we go to next page next records from 51 to 100 records will be stored in store.
Two solutions for your requirement:
pageSize:500
buffered:true
in Ext.data.storeOn setting buffered:true
, you can get all records of store at a time by using grid.store.getRange(start, end)
. But in this case you need to load the store once for the first time.