Reputation: 232
I have a grid, when i load data to grid, i paging it with pageSize: 10
, i want get the data store from that grid for checking the redundant data in other grid, but i just get 10 data because i already set pageSize 10, actualy the data is more than 10.
How do i get all data in the grid already paging?
I already use proxy type "pagingmemory" but not working This is my store :
var store = Ext.create('Ext.data.Store', {
//extend: 'Ext.data.Store',
model: settings.namespace + 'model.FormRequestDetailModel',
remoteSort: true,
remoteFilter: true,
autoLoad: false,
pageSize: 10,
//proxy: {
// type: 'pagingmemory'
//},
sorters: [{
property: 'FormRequestNo',
direction: 'ASC'
}]
});
var filters = [];
var filter = {
property: 'FormRequestID',
value: data.ID
};
filters.push(filter);
store.filters.clear();
if (filters.length == 0) {
store.load();
} else {
store.filter(filters);
}
This is the model :
//-----------Structure for PurchaseOrder -----------------------//
Ext.define(settings.namespace + 'model.FormRequestDetailModel', {
extend: 'Ext.data.Model',
fields: [{
name: 'ID',
mapping: 'ID'
}, {
name: 'FormRequestID',
mapping: 'FormRequestID'
}, {
name: 'MaterialStockID',
mapping: 'MaterialStockID'
}, {
name: 'MaterialID',
mapping: 'MaterialID'
}, {
name: 'Item',
mapping: 'Item'
}, {
name: 'MaterialNo',
mapping: 'MaterialNo'
}, {
name: 'MaterialDescription',
mapping: 'MaterialDescription'
}, {
name: 'Quantity',
mapping: 'Quantity'
}, {
name: 'UOMID',
mapping: 'UOMID'
}, {
name: 'UOMDescription',
mapping: 'UOMDescription'
}, {
name: 'GLAccountID',
mapping: 'GLAccountID'
}, {
name: 'GLAccountNo',
mapping: 'GLAccountNo'
}, {
name: 'GLAccountDescription',
mapping: 'GLAccountDescription'
}, {
name: 'InternalAgreement',
mapping: 'InternalAgreement'
}, {
name: 'FundReservationNo',
mapping: 'FundReservationNo'
}, {
name: 'AssetNo',
mapping: 'AssetNo'
}, {
name: 'DeliveryDate',
mapping: 'DeliveryDate'
}, {
name: 'Background',
mapping: 'Background'
}, {
name: 'Purpose',
mapping: 'Purpose'
}, {
name: 'UrgencyID',
mapping: 'UrgencyID'
}, {
name: 'UrgencyDescription',
mapping: 'UrgencyDescription'
}, {
name: 'LineStopPotentialID',
mapping: 'LineStopPotentialID'
}, {
name: 'LineStopPotentialDescription',
mapping: 'LineStopPotentialDescription'
}, {
name: 'BackupListID',
mapping: 'BackupListID'
}, {
name: 'BackupListDescription',
mapping: 'BackupListDescription'
}, {
name: 'ReplaceID',
mapping: 'ReplaceID'
}, {
name: 'ReplaceDescription',
mapping: 'ReplaceDescription'
}, {
name: 'FormRequestStatusID',
mapping: 'FormRequestStatusID'
}, {
name: 'IsDrop',
mapping: 'IsDrop'
}, {
name: 'RejectionReasonID',
mapping: 'RejectionReasonID'
}, {
name: 'RejectionReason',
mapping: 'RejectionReason'
}, {
name: 'CreatedTime',
mapping: 'CreatedTime'
}, {
name: 'CreatedBy',
mapping: 'CreatedBy'
}, {
name: 'LastModifiedTime',
mapping: 'LastModifiedTime'
}, {
name: 'LastModifiedBy',
mapping: 'LastModifiedBy'
}, {
name: 'RowStatus',
mapping: 'RowStatus'
}, {
name: 'RejectionReason',
mapping: 'RejectionReason'
}, {
name: 'Approved',
type: 'boolean',
defaultValue: false
}],
idProperty: 'ID',
proxy: {
type: 'ajax',
url: settings.apiUrl + 'FormRequest/GetDetail',
actionMethods: {
read: 'POST'
},
reader: {
type: 'json',
root: 'data.rows',
totalProperty: 'totalCount'
}
},
sorters: [{
property: 'ID',
direction: 'DESC'
}]
});
Upvotes: 0
Views: 2579
Reputation: 23
You can create a loop to change the page when finished until all the values are retrieved.
I think this may resolve your problem. https://stackoverflow.com/a/33785646/5577577
Upvotes: 0
Reputation: 19915
The grid view is bound to the store. That means, if your grid is visible, and you load a different dataset into the store, the view will reflect the changes immediately.
This is how I would approach this problem : Create a second store with the same data source, but without paging. Then before loading the unpaged dataset, you apply the filters on the grid to the second store.
Note about the model : you do not need to declare the mapping
if it is the same than the name
. Rather declare the type
, this is important for formatting or if the grid is editable.
Upvotes: 1