PDA

View Full Version : store baseparams not being updated



seanrock
11 Nov 2010, 6:39 AM
Hi

I have a form with various inputs and a grid. A user enters data into the fields or selects items from combos and clicks the form's 'submit' button. the button handler gets the form values and sets the baseParams of the store object which is the store of the grid and the grid shows the results. This works fine however when i page to the last page of the grid - then make a change in the form and click the submit button the previous values are still being sent to the server. I've viewed this in firebug and the new values from the form are being assigned to the baseParams of the store object but not sent to the server when i call store.reload(). Again this only happens when i page to the last record in the grid - otherwise it works fine.

*** Edit ***
if i use the pager at all (prev,next, first, last, refresh), the baseParams of the store are not being updated properly.


Any help is appreciated.


Thanks
Sean

httpdotcom
11 Nov 2010, 7:47 AM
http://dev.sencha.com/deploy/dev/docs/source/Store.html#method-Ext.data.Store-reload
reload( Object options ) : void
Reloads the Record cache from the configured Proxy using the configured Reader and the options from the last load operation performed.

seanrock
11 Nov 2010, 7:56 AM
Thanks for your reply, however i did state that i was calling reload().

seanrock
11 Nov 2010, 8:06 AM
Answer:

store.lastOptions = null;

[ set new baseParams ]

store.reload();

httpdotcom
11 Nov 2010, 8:18 AM
I understand your response, but perhaps you didn't understand mine (tried to signify the issue with highlighting).
baseParams should be values submitted with each load/reload of the data store. Otherwise, you should be using params, which is what the grid pager updates (values like start and limit).

seanrock
11 Nov 2010, 8:39 AM
Ok i understand now - thanks.