PDA

View Full Version : PagingToolbar and different parameters



ppolyzos
26 Nov 2007, 4:10 AM
I have a grid panel with a paging toolbar at the bottom of it.
Is there any way to pass more parameters according to what arrows user presses?

For example if the user presses the next button I also would like to pass a parameter for the times the arrow has been pressed or the id of the grid panel....

Thanks in advance

hendricd
26 Nov 2007, 4:55 AM
If you examine the source for PagingToolbar, the onRender method sets you up with everything you'll need (button references):



pagingTB.on('render',function(tbar){
tbar.clickStats = {};
var clickCount = function(button){

this.clickStats[button]++;

};
Ext.each(['first','prev','next','last'],function(button){
this.clickStats[button]= 0;
this[button].on('click',clickCount.createDelegate(tbar,[button])
},tbar);

tbar.store.on('beforeload', function(store,options){
options.params || (options.params = {});
Ext.apply(options.params, this.clickStats);
}, tbar);
},null,{single:true});

ppolyzos
26 Nov 2007, 5:54 AM
Thank you so much!
That helped me a lot