Nov 30, 2010, 11:32 PM
[CLOSED] Updated Store baseParams with setBaseParam not sent during Store.Load
Hi,
I'm finding a similar problem to what is described here:
http://forums.ext.net/showthread.php...am-not-working
In short, with a Proxy, if I update a baseParam using setBaseParam, the updated value does not get sent in the Load call. Instead the old param is passed.
I have modified your own Handler example here:
https://examples1.ext.net/#/GridPane...rting/Handler/
I have added just 2 things:
1) To demonstrate the problem: a TopBar with a button, which, when clicked updates the 'limit' base param with a different value (e.g. mimicking the ability to change the page size). It then goes back to page 1 which forces a reload:
2) A workaround: a BeforeLoad listener to the Store that will apply the updated params to the params object that is passed to the server. I would expect that setBaseParams should be enough and this BeforeLoad listener would not be needed?
Btw, I can see the same problem with a PageProxy. Using your own example:
https://examples1.ext.net/Examples/G..._Sorting/Page/
In Firebug, you can run these two commands:
Let me know if you want full examples.
I'm finding a similar problem to what is described here:
http://forums.ext.net/showthread.php...am-not-working
In short, with a Proxy, if I update a baseParam using setBaseParam, the updated value does not get sent in the Load call. Instead the old param is passed.
I have modified your own Handler example here:
https://examples1.ext.net/#/GridPane...rting/Handler/
I have added just 2 things:
1) To demonstrate the problem: a TopBar with a button, which, when clicked updates the 'limit' base param with a different value (e.g. mimicking the ability to change the page size). It then goes back to page 1 which forces a reload:
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button Text="Set Page Size to 10" runat="server">
<Listeners>
<Click Handler="#{Store1}.setBaseParam('limit', 10); #{PagingToolbar1}.changePage(1);" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
On its own, the above does not work. If you inspect the request, you see the original 'limit' being sent. Hence this second bit:2) A workaround: a BeforeLoad listener to the Store that will apply the updated params to the params object that is passed to the server. I would expect that setBaseParams should be enough and this BeforeLoad listener would not be needed?
<Listeners>
<BeforeLoad Handler="Ext.apply(options.params, this.baseParams, options.params);" />
</Listeners>
Have I missed something or is the BeforeLoad handler always needed?Btw, I can see the same problem with a PageProxy. Using your own example:
https://examples1.ext.net/Examples/G..._Sorting/Page/
In Firebug, you can run these two commands:
GridPanel1.store.setBaseParam('limit', 2);
GridPanel1.bottomToolbar.changePage(1);
If you inspect the Post, you will see the limit sent back to the server is 3, not 2.Let me know if you want full examples.
Last edited by Daniil; Dec 02, 2010 at 7:50 AM.
Reason: [CLOSED]