Results 1 to 3 of 3

Thread: Move config.io to Ext.io.Controller?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    88
      0  

    Default Move config.io to Ext.io.Controller?

    As part of my experimentation with Ext.io.Controller, I've created an Authentication controller that simply extends Ext.io.Controller and implements custom methods as necessary. Seems to work just fine.

    At the moment, all of the config for io is set in the main application config. Just a thought, but does it make sense to allow that configuration to be set in the controller itself (or extends of the controller)?

    The following worked for me:

    Code:
    Ext.define('MyApp.controller.Authentication', {
            extend: 'Ext.io.Controller',
            config: {
                io: {
                    logLevel: 'debug',
                    appId: '5udcINurg7MjiKE3wpQwemKhnlS',
                    appSecret: 'Psyp6ttPyBO2W5WU',
                    authOnStartup: false,
                    manualLogin: true
                }   
            }
    })
    And then a slight mod in sencha-io-debug (line 16022, build:0.8.7):

    Code:
    var conf  = this.config.io;
    16123:
    Code:
    auth: function() {
        this.login(!this.config.io.manualLogin);
    }
    Thoughts?

  2. #2
    Sencha - IO Dev Team
    Join Date
    Apr 2011
    Posts
    91
    Vote Rating
    6
      0  

    Default

    Thanks for the feedback. We could build the controller this way where the developer extends Controller like they do Stores and add their configuration and extensions. We will explore this as we continue to refine the API.

    The main reason why the config is part of the application at the moment is because you can only have one sencha.io application configured and running at a time. If the config is part of the controller then someone might be tempted to have two controllers in the same application with different configs which at the moment would cause problems.

  3. #3
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    88
      0  

    Default

    Ah, that makes sense. Thanks!

Posting Permissions

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