1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Duluth, MN
    Posts
    126
    Vote Rating
    4
    badgerb1 is on a distinguished road

      1  

    Red face Overriding Application question

    Overriding Application question


    Hi Guys,

    I'm attempting to override application so that we can add some baked in functionality for a suite of products that will all use the same base.

    Application.js
    Code:
    Ext.define("MyApp.mobile.Application", {
        override:"Ext.app.Application",
    
    
        requires:[
            'MobileApp.controller.mobileFramework.security.SetupDevice',
            'MobileApp.controller.mobileFramework.security.Security'
    
    
        ],
        config:{
            controllers:[
            'MobileApp.controller.mobileFramework.security.SetupDevice',
            'MobileApp.controller.mobileFramework.security.Security']
        }
    });
    app.js
    Code:
    Ext.application({
        name:'MobileApp'
    });
    The problem is the config items I put in the override don't get used so the controllers are not loaded. I can force them to be put in like this.

    Code:
    Ext.define("MyApp.mobile.Application", {
        override:"Ext.app.Application",
    
    
        requires:[
            'MobileApp.controller.mobileFramework.security.SetupDevice',
            'MobileApp.controller.mobileFramework.security.Security'
    
    
        ],
        constructor:function(config){
            config = config || {};
            config.controllers = config.controllers || [];
            config.controllers.push('mobileFramework.security.Security');
            config.controllers.push('mobileFramework.security.SetupDevice'); 
            this.callParent(arguments);
        }
    });
    But that seems kind of weird.
    Should you be able to define configs in an override?
    If not how would I add a new config type property to a class? I.E.

    Code:
    Ext.define("MyApp.mobile.Application", {
        override:"Ext.app.Application",
    
    
        requires:[
            'MobileApp.controller.mobileFramework.security.SetupDevice',
            'MobileApp.controller.mobileFramework.security.Security'
    
    
        ],
        config:{
            newConfig:'my new configuration item'
    }
    });
    This doesn't add the newConfig item.

    Thanks
    Bob

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,703
    Vote Rating
    749
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You shouldn't do that to Application. You should just have the requires and the controllers in the Ext.application call.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Duluth, MN
    Posts
    126
    Vote Rating
    4
    badgerb1 is on a distinguished road

      0  

    Default


    I was afraid of that.

    What I'm trying to avoid is supporting a bunch of different apps with the same functionality in each, and overriding application to bake in the basics would be perfect.

    Thanks though.
    Bob

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar