PDA

View Full Version : Additional Parameters not persistent on paging grid



kliolios
18 Aug 2011, 5:00 PM
var store = Ext.create('Ext.data.Store', {
pageSize: itemsPerPage,
autoload: false,
model: 'project',
baseParams: {
'extra': 'complete'
},
proxy: {
type: 'ajax',
url : '/PHP/proxy.php',
reader: {
type: 'json',
root: 'data',
totalProperty: 'total'
}
}
});

store.load({
params:{
start: 0,
limit: itemsPerPage,
'extra': 'complete'
}
});

var grid = Ext.create('Ext.grid.Panel', {
title: 'blah',
store: store,
columns: [
...
],
height: 500,
width: 1100,
dockedItems: [{
xtype: 'pagingtoolbar',
store: store, // same store GridPanel is using
dock: 'bottom',
displayInfo: true
}],
renderTo: 'topic-grid'
});

// trigger the data store load
store.loadPage(1);



The paging grid loads great the first time. But when I try to click to the next page it appears that my extra parameter does not get POSTED. I have set it to the store's baseParams as it is advised on http://www.sencha.com/learn/grid-faq/ but that does not seem to work.

Thanx in advance
Dino

kliolios
18 Aug 2011, 5:20 PM
It looks baseParams do work after all if they are set in the proxy and not the store. Sorry for posting this.

kliolios
19 Aug 2011, 2:30 PM
I was too hasty. It actually still not working. Stevil please feel free to merge this thread with my original one or keep them separate. I created this one because:
1. Didn't realize I had to enclose code in code tags
2. The forum probably prefers different issues to be in different threads

kliolios
20 Aug 2011, 12:27 PM
Problem solved. Apparently you have named baseParams in extJS v4 extraParams