PDA

View Full Version : Form-variables and paging



faro
29 Oct 2007, 7:44 AM
hello,
does anybody know how to tell extjs to use values from a form on paging-action?
i already tried:

Ext.apply(my_datasource.baseParams,this.fs.getValues())
my_datasource.load({params:{start:0, limit:MAX_NUMBER_RESULTS}, arg:[Ext.decode(Ext.encode(my_datasource.baseParams))]});

my_datasource.on("beforeload", function(){
Ext.apply(my_datasource,this.fs.getValues());
}


First time the grid loads the results inside are correct. if i hit the page-button the form-values will not be used anymore..seems to me like a bug..any idea?

greetings

ferr
30 Oct 2007, 11:40 AM
This is also happening to me, I cannot get my parameters transfered over when the next page event is fired. In my system, my data store is initially loaded via a button, so in that instance it uses the parameters I give it since it has no other options, but with paging, there seems to be a hidden option.. it does not seem to use the global data store load call, rather a hidden call (i.e. I'll set the data store load to have a limit of 45 records per page, and within the paging config I will set the pageSize to 25, the number of records returned per page is 25). That's all fine and dandy that I can modify the pageSize through the paging config, but what if I want additional parameters to go along with the data store load?

How can I intercept / modify the parameter list sent in at the time of a paging data store load?

JeffHowden
30 Oct 2007, 12:21 PM
Attach a listener to the beforeload event of the store. Then, in your listener, simply update the baseParams to send anything extra that's necessary.

http://extjs.com/forum/showthread.php?t=2758&highlight=paging+beforeload

ferr
30 Oct 2007, 12:37 PM
Thanks, works perfectly.