Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Dynamic url Store

  1. #11
    Sencha Premium Member
    Join Date
    Jan 2010
    Location
    Vancouver, Canada
    Posts
    259
    Answers
    4

    Default

    @saandrango: I know it's a very late answer and probably the code is not relevant anymore. I think the mistake is in the line:

    url = CV.store.Constantes.BASE_URL;
    It should have been imo:
    Code:
    config.url = CV.store.Constantes.BASE_URL + "/some/other/path";
    Having said that, I don't think it was necessary to override processConfig for the proxy because the buildUrl of the ajax proxy class was overridden (I haven't tested but I assumed ssamayoa's answer was correct), so I think you only needed to assign the relative url in the proxy config and that was it.

  2. #12
    Sencha Premium User EricRicher's Avatar
    Join Date
    Jul 2014
    Posts
    45

    Default

    I just started a thread related to this in the ExtJS forum before I stumbled on this one.

    I also use Architect and have a dev and prod environment. I use Process Config to set the url of proxies to point to either a dev or a prod server. However, I use the build environment to define a base url that ends in the Ext.manifest and it works well.

    I added the following to the app.json:

    Code:
      "production": {
          "baseurl": "https://www.enofily.com/api"
       },
       "testing": {
          "baseurl": "https://www.enofily.com/api"
       },
       "development": {
          "baseurl": "/api"
       }
    The "baseurl" ends up in the manifest as Ext.manifest.baseurl and I use it like this in any Process Config functions in Architect:

    Code:
       processMyRestProxy: function(config) {
            config.url = Ext.manifest.baseurl+config.url;
            return config;
        }
    However, one issue that I am having with this method is that not all classes in Architect have Process Config and the most notable is the data.model class where I can't do this for the model's proxy config. Hence my other thread to see what other people are doing.

    If Architect allowed the user to set the url config to something else than a string, one could enter directly Ext.manifest.baseurl+'/path/to/service' directly in the config pane. Maybe that could be an improvement to Architect.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 4
    Last Post: 20 Nov 2015, 2:15 AM
  2. Replies: 2
    Last Post: 15 Oct 2015, 11:12 PM
  3. Replies: 3
    Last Post: 27 Jun 2012, 12:53 AM
  4. Iterating over Stor
    By faisal abbas in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 26 Feb 2009, 10:48 PM
  5. im using same stor for 2 combobox and gride
    By mnask in forum Ext 2.x: Help & Discussion
    Replies: 18
    Last Post: 2 Apr 2008, 1:34 AM

Posting Permissions

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