1. #1
    Sencha User daubman's Avatar
    Join Date
    Jul 2010
    Location
    Massachusetts
    Posts
    34
    Vote Rating
    2
    daubman is on a distinguished road

      0  

    Question Correct way to obtain component references?

    Correct way to obtain component references?


    When using Designer 1.2.2-48 exported code, which unfortunately doesn't adhere to the new MVC standards, what is the correct way to obtain references to components?

    e.g. for the following code (view, not the ui) there are no getters created for the refs or stores:

    Code:
    Ext.define('LaunchEventWindow.view.MyViewport', {
        extend: 'LaunchEventWindow.view.ui.MyViewport',
    
        refs: [{
            // A component query
            selector: 'viewport > gridpanel',
            ref: 'lewGridPanel'
        }],
    
        stores: ['LaunchEvents'],
    
        initComponent: function() {
            var me = this;
            me.callParent(arguments);
    
            var myStore = getLaunchEventsStore(); //FAILS, does not exist
    
            var myPanel = getLewGridPanel(); //FAILS, does not exist
            console.debug(myPanel.getId());
        }
    });
    What is the correct way to get a reference to the viewport INSTANCE (or the gridpanel within the viewport) when not using the MVC code with the controllers, etc... as specified here:
    http://docs.sencha.com/ext-js/4-0/#!/guide/mvc_pt3
    Last edited by daubman; 23 Nov 2011 at 1:58 PM. Reason: cleaning up code formatting

  2. #2
    Sencha Premium Member lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    633
    Vote Rating
    13
    lorezyra will become famous soon enough lorezyra will become famous soon enough

      0  

    Default store lookup

    store lookup


    Try this...

    PHP Code:
    Ext.StoreMgr.lookup("lewGridPanel"); 
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!
    ================================================
    And here are my terms...
    1. I don't care if you use my source code. (Known as "Code.")
    2. I don't care if I get any monetary compensation.
    3. I do care to receive credit for Code provided. So, please keep my name in the comments for Code provided.
    4. Code is provided without warranty "AS-IS" and I claim absolutely no warranty nor liability to the quality, security, and run-ability on any platform.
    5. By using Code, you accept all risk inherit with Code regardless if Code has known and yet to be discovered bugs.
    6. You are welcome to change and improve the Code to best meet your needs.
    7. I don't care if you use the Code in a commercial or open-source project.
    8. You are not required to contact me prior to using the Code.
    ================================================
    Simple. Enjoy.

  3. #3
    Sencha Premium Member lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    633
    Vote Rating
    13
    lorezyra will become famous soon enough lorezyra will become famous soon enough

      0  

    Default


    Quote Originally Posted by daubman View Post
    ...
    What is the correct way to get a reference to the viewport INSTANCE (or the gridpanel within the viewport) when not using the MVC code with the controllers, etc... as specified here:
    http://docs.sencha.com/ext-js/4-0/#!/guide/mvc_pt3
    Alternately, for components, you can still go old-school with Ext.getCmp()... You may notice many of the 4.0 examples still use the old 3.x logic and not so much the MVC scheme...
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!
    ================================================
    And here are my terms...
    1. I don't care if you use my source code. (Known as "Code.")
    2. I don't care if I get any monetary compensation.
    3. I do care to receive credit for Code provided. So, please keep my name in the comments for Code provided.
    4. Code is provided without warranty "AS-IS" and I claim absolutely no warranty nor liability to the quality, security, and run-ability on any platform.
    5. By using Code, you accept all risk inherit with Code regardless if Code has known and yet to be discovered bugs.
    6. You are welcome to change and improve the Code to best meet your needs.
    7. I don't care if you use the Code in a commercial or open-source project.
    8. You are not required to contact me prior to using the Code.
    ================================================
    Simple. Enjoy.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."