PDA

View Full Version : [CLOSED]Ext.PagingToolbar: use store.lastOptions when changiong page



gianmarco
3 Jun 2010, 2:44 AM
Hi, I'm filling a GridPanel with bounded PagingToolbar using this code:


var args = {val1: 'a', val2: 'b'}; // Some custom parameters
this.gridPanel.getStore().load({
params: Ext.apply({
start: 0,
limit: this.gridPanel.getBottomToolbar().pageSize
}, args)
});
The grid is loaded correctly, but when i change page with PagingToolBar the custom parameters are not kept. To workaround i use the following code:


new Ext.PagingToolbar({
store: store,
listeners: {
beforechange: function (paging, params) {
var lastParams = (paging.store.lastOptions || {}).params || {}
Ext.applyIf(params, lastParams);
}
}
})
The fact that PagingToolbar doesn't consider previuosly used parameters is a BUG or is by design for some reason?

evant
3 Jun 2010, 2:53 AM
You should use the baseParams, that's what they are there for.