1. #11
    Sencha User
    Join Date
    May 2010
    Posts
    20
    Vote Rating
    0
    FidoX is on a distinguished road

      0  

    Default


    To emulate that behavior, I set the itemId of the widget, and then in the controller:

    Code:
    control:
        'MyPanel button[itemId="centerButton"]': {
            ...
        }
    Maybe not than fast as #centerButton but at least is so specific.

  2. #12
    Sencha User
    Join Date
    Jun 2008
    Posts
    26
    Vote Rating
    0
    astagl is on a distinguished road

      0  

    Default


    Quote Originally Posted by rdougan View Post
    Still makes no sense to me. You should be able to access any component with it's ID at any time, even within a card layout.

    Could you post a simple test case to replicate this behavior?
    I'm happy to hear that someone knows this. I'm currently having issues accessing an item within an action column:

    PHP Code:
     
                     
    header 'Actions'
                     
    sortable false,
                     
    menuDisabled true,
                     
    width 100 ,
                     
    xtype 'actioncolumn'
                     
    align 'center',
                     
    items: [{
                         
    iconCls'fam_accept',
                         
    tooltip'Watch Project',
                         
    itemId'watch',
                         
    bodyStyle 'width:16px'
                     
    }, {
                        
    icon'/icons/application_go.png',
                        
    itemId 'show',
                        
    tooltip'Show Dashboard'
                    
    }]
                 } 
    I cannot get to #watch to save my life. I can get to the actioncolumn with:

    PHP Code:

                
    'projectList actioncolumn': {
                    
    clickthis.watchProject
                
    }, 
    but applying the item id gets me nowhere:

    PHP Code:

                
    'projectList actioncolumn #watch': {
                    
    clickthis.watchProject
                
    }, 
    Anyone know what I'm missing here?

  3. #13
    Sencha User cyberwombat's Avatar
    Join Date
    Oct 2011
    Posts
    237
    Answers
    6
    Vote Rating
    2
    cyberwombat is on a distinguished road

      0  

    Default


    I'm shooting in the dark myself but I don't think itemId turns into a css ID - isn't it 'id'? try:

    Code:
    'projectList actioncolumn [itemId="watch"]': {...

  4. #14
    Sencha User
    Join Date
    Jun 2008
    Posts
    26
    Vote Rating
    0
    astagl is on a distinguished road

      0  

    Default


    Yes, I tried that as well with no luck. I want to do this right, but I cannot seem to get the selectors to work properly with action columns. I'm going to do more research...

  5. #15
    Sencha User
    Join Date
    Jun 2008
    Posts
    26
    Vote Rating
    0
    astagl is on a distinguished road

      0  

    Default


    OK, now that I've thought about this for a while, I can see why my selector does not work. Upon inspecting the items within the action column, the items added are not components. They are plain ol' images.

    Per rdougan's comment, only "components" may be accessible from the controller.

    That kind of makes the action column pretty lame for MVC development now, doesn't it?

  6. #16
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    193
    Answers
    3
    Vote Rating
    24
    elgs will become famous soon enough

      0  

    Default


    I have the same problem. I agree that we should avoid putting logic in the view. However, my buttons are generated dynamically, so I want my runtime button to be well encapsulated. It might be debatable if this is good design. However, I'm really hoping the controllers are more accessible from anywhere. I will go on to do some investigation, and come back here if I found a way.

  7. #17
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    193
    Answers
    3
    Vote Rating
    24
    elgs will become famous soon enough

      0  

    Default


    Now I have a temporary workaround, but the performance seems to be very poor.

    var controller =Ext.create('Full.Classname.Of.Your.Controller');The code above happens in my button handler. The reason I need to put this logic in a button controller instead of the controllers is that my buttons are generated dynamically at run time. I need my button's to be well encapsulated instead of having a footprint in the controller. My code si 4.1.1a. Thanks.