1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Vote Rating
    1
    scheid is on a distinguished road

      0  

    Default Proper/appropriate way to get references to objects

    Proper/appropriate way to get references to objects


    Hi All,

    I'm just learning Sencha, and have seen different ways to get references to objects like views. I want to ensure that I'm doing it in a proper way that isn't spawning new instances, etc.

    I use the technique below to navigate to cards in a card layout, which works well from a UI perspective. Is ComponentQuery.query a good way to get object references?


    var mView = Ext.ComponentQuery.query("mainview")[0];
    var moreMessagesView = Ext.ComponentQuery.query("moremessages")[0];

    mView.setActiveItem(moreMessagesView);


    Thanks!

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Location
    Cedar Rapids, IA
    Posts
    63
    Vote Rating
    1
    aoathout is on a distinguished road

      0  

    Default


    This logic is better served in a controller and then use the 'refs' config. This will let you get references to views and keep the logic of switching views out of your UI layer. Plenty of examples / posts for using 'refs' in the forums

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Vote Rating
    1
    scheid is on a distinguished road

      0  

    Default


    Thanks so much. I'll look into incorporating the obj references there instead. I have started to use refs for some things, but don't fully understand its behavior yet. Seems powerful though.

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Location
    Cedar Rapids, IA
    Posts
    63
    Vote Rating
    1
    aoathout is on a distinguished road

      0  

    Default


    Take a look at the following. Should be helpful as examples of mvc and using the new features:

    http://www.sencha.com/forum/showthre...le-MVC-example


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