Results 1 to 3 of 3

Thread: proxy parameters - dynamic at startup, and dynamic from user

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Apr 2013
    Vote Rating

    Default proxy parameters - dynamic at startup, and dynamic from user

    I am in the early stages of an app that will be, I think, fairly straightforward representation and occasional update of an existing, unmodifiable RESTful JSON database. I am struggling with a couple things, at this moment most noticeably the store proxy, and a couple of dynamic parameters that are needed.

    First, the basic code:
    Ext.define('', {
        extend: '',
        config: {
            model: 'TouchMill.model.Tournament',
            autoLoad: false,
            proxy: {
                type: 'ajax',
                //url: 'test/data/tournaments.json',      // will change once dynamic
                url: '',
                reader: { type: 'json', rootProperty: 'objects', },
                extraParams: {
                    access_token: 'TOKEN',
                    tournament_ids: '[18091,18093,18094]',  // XXX need to put this into a config opt
    In this case, I need to dynamically modify 2 things.
    • config.proxy.url: the particular html file that's loaded sets a global variable, based on which I choose the URL
    • config.proxy.extraParams.access_token: that comes from the login step (or localStorage, if already logged in), meaning that the app is already launched
    So, how do I correctly, from another file (app.js, or controller.Main) update these? And secondly, how do I defer loading until the right time? Setting autoload: false merely gave me a blank page instead of actually loading when I wanted.

    And the update question could be more specific -- it boils down to this: where can I learn how to access and update things from other locations? Is there something documenting how to access app elements from other scopes?



    PS - tips on where in tutorials/vids/docs to find this would be awesome. I've watched several, looked at a few examples, and not found it so far...
    Last edited by benomatic42; 12 May 2013 at 6:58 AM. Reason: PS

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts