-
16 May 2012 8:47 AM #11
I placed that piece of code inside my onJsonstoreBeforeLoad event in the store. If you look at my first post, I replaced:
with:Code:Ext.apply(store.getProxy().extraParams, { name: 'test' });
Code:store.getProxy().setExtraParam('name', 'test');
-
16 May 2012 9:51 AM #12
-
16 May 2012 10:11 AM #13
I had problems getting this to work correctly outside the store:
It just wouldn't load the extra parameters to the store. Granted I may have been calling it from the wrong location, or something, but doing a call on the before load event within the store I was able to pass the extra params. Of course within the on load event, you wouldn't want to call the store.load event again unless you want to be stuck within an infinite loop.Code:store.getProxy().setExtraParams({name:'test'}); store.load();
I have used ExtJs on websites and I have some understanding of how it works, but I have had some serious problems trying to figure out how Architect works. I think these products are really good for online applications, but they need some serious improvements in their documentation and tutorials. Especially since most of the tutorials I find to try and figure this stuff out are for older versions that are no longer applicable.
-
16 May 2012 10:24 AM #14
When should you add the params? Is it because they are dynamic so you would like to add them at the start or?
Because you can add them directly in the Architect if they are static. If not you can grab the store and add them as said before, are doing that all the time in my applications.
-
16 May 2012 10:53 AM #15
What I want to do is update a list of items based on current location. If you have a sample of code where you were able to adjust store params succesfully in your app, then I would love to see it. Most of the time I get small snippets, one or two lines, that don't help me a whole lot because they are out of context. I found a nice twitter tutorial when I started and tried to duplicate, but it was using an older version and I had some trouble modifing it to work in architect.
-
16 May 2012 2:44 PM #16
onStoreBeforeLoad
onStoreBeforeLoad
Hello,
I think they are talking of an event binding on the store itself.
Click your store in the project inspector.
Go to Event Bindings in the config panel below.
Click the + button to add an event.
Use the Event type chooser box to choose beforeload.
This will give you a function skeleton with the store as a parameter to the function.
Add in this:
store.getProxy().setExtraParam('my_param_name', value);
The params you want to set this way need to be available before the store loads.
-
16 May 2012 9:42 PM #17
Also, if your are using ExtDirect you need to add the param names to paramOrder
e.g.
Code:orgid=item.orgid; var bookings = Ext.data.StoreManager.lookup('Bookings'); bookings.proxy.paramOrder=['start','limit','orgid','startdate']; bookings.proxy.extraParams={orgid:orgid,startdate: '2012/01/20'};
-
16 May 2012 11:51 PM #18
Mini project where it loads the store when pressing load button. It could be any other event. The store is connected to a list but it could be something else.
Note. I have not tested it because I don't have the correct URL for the proxy and the Model has no fields
I hope it helps.
-
17 May 2012 2:58 AM #19
-
17 May 2012 4:45 AM #20


Reply With Quote