• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED] MVC using config settings?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED] MVC using config settings?

    When using the following in a MVC app, does it "have to" be set during the launch function in the app.js, or can it be set at anytime?

    Ext.define('ImageInquiry.config.Settings',{
    singleton: true,
    config: {
    emailAuthority: 'N',
    faxAuthority: 'N',
    addNotesAuthority: 'N',
    detailmaintAuthority: 'N',
    detailinfoAuthority: 'N',
    zoptAuthority: 'N',
    routeAuthority: 'N',
    auditAuthority: 'N',
    scanAuthority: 'N',
    uploadAuthority: 'N'
    },
    constructor: function(config){
    this.initConfig(config);
    }
    });

    I did an Ajax.request to get the settings (after launch) and when I tried to use the following in my view.js for my grid I got an error that the setting was not found.

    hidden: (ImageInquiry.config.Settings.getEmailAuthority() ==='N') ? true : false

  • #2
    What occurs if you remove your constructor function?

    Comment


    • #3
      no difference... here's a screen shot of the error when i try to set the value... i had to take it out of the view.js completely b/c the whole app would not load if I had--> hidden: (ImageInquiry.config.Settings.getEmailAuthority() ==='N') ? true : false
      in the view... so something is awry with the path.. if it won't let the view load it it can't find it when the app loads.. i'm perplexed...
      When I've used this in the past, I've done it in the app.js, but it does not seem like it would matter. MVC should find the path the the config/settings by default (I would think)

      mvc.jpg

      Comment


      • #4
        just for fun i put this in the launch function of the app
        var test = ImageInquiry.config.Settings;
        console.log(test);

        it doesn't even find it at this point... i checked my spelling and it looks ok to me.. but i am getting old...
        if it can't find it here, i'm stumped... makes no sense (at this point).. i'm sure there's a reason though..

        Comment


        • #5
          Do you have ImageInquiry.config.Settings in 'requires' at app level? If not try adding it and see if it works.

          Comment


          • #6
            i added it.. it blew on the Ext.require... weird... must be a path issue or something... i'm still trying...

            Comment


            • #7
              note to self: i am old now and can't see much difference between a g and a q so look harder or get new glasses

              (once i spelled requires correctly it worked fine)

              Comment

              Working...
              X