Results 1 to 2 of 2

Thread: Dynamic/variable "url" in ajax proxy

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Vote Rating

    Default Dynamic/variable "url" in ajax proxy

    I'm trying to find a way to dynamically change the 'url' part of the in my ajax stores.

    Currently, Architect only accepts a String value like '', but this is restrictive for me, because while the application is running, I'd like to be able to switch to a different url on all stores at the same time.

    Any help would be appreciated.

    Thank you.

  2. #2
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Stockholm, Sweden
    Vote Rating


    I suggest putting that logic in a central function setting up the proxies for the different stores. I have 20+ Stores that I configure along the lines:
    Ext.getStore('CertStore').getProxy().url = UP8.config.backend + 'certs';
    Ext.getStore('ActiveVoucherStore').getProxy().url = UP8.config.backend + 'vouchers/active';
    Ext.getStore('RedeemedVoucherStore').getProxy().url = UP8.config.backend + 'vouchers/redeemed';
    Ext.getStore('CreditStore').getProxy().url = UP8.config.backend + 'credits';
    Ext.getStore('ExamStore').getProxy().url = UP8.config.backend + 'exams';
    In the app.init() function and the UP8.config is set by the server in the app.html that is generated when the user access the page.
    While I haven't tried changing the URL on the fly at least this lets me set the url in SA to something that makes sense while developing (to get bogus data from the backend) and when actually running in a browser the init() is executed and all is working.


Posting Permissions

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