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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      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
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    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
  •