Results 1 to 2 of 2

Thread: Dynamic refs in Controller

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    62
    Answers
    7
    Vote Rating
    0
      0  

    Default Dynamic refs in Controller

    Hello Sencha Peeps

    I was wondering it is possible to have a variable in the refs part of a controller :
    For example :
    Code:
    refs : {
    main : Ext.Viewport.getActiveItem().id + " #main"
    }
    I have the same general structure for each of my view (but not so similar that I can create a seperate xtype) and I won't to have a controller per view because that would mean a lot of duplicate code.

    I also tried doing this :
    Code:
    this.main.config.refs.main = Ext.Viewport.getActiveItem().id + "#main"
    But it does not seem to update at all.

    If anyone has some ideas they will be very much appreciated.

    Thanks,
    Sarah
    Sarah Burrell
    R & D Developer at Novadys International

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    refs are really static references, you should have them setup for global views not views that you will be creating instances and destroying them. Also, I'd stay away form the id config.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

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