1. #1
    Sencha User
    Join Date
    Apr 2010
    Posts
    8
    Vote Rating
    0
    awhitford is on a distinguished road

      0  

    Question Panel.getTool missing in Ext4

    Panel.getTool missing in Ext4


    I have a Panel with a tool (refresh button), but Panel.getTool no longer exists in Ext4. How can I get a handle to it so that I can hide it?

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    198
    Vote Rating
    1
    Nickname is on a distinguished road

      0  

    Default


    Docs say:

    Code:
    An array of Ext.panel.Tool configs/instances to be added to the header tool area. The tools are stored as child components of the header container. They can be accessed using down and {#query}, as well as the other component methods.
    So basicly: panel.down('tool[type=refresh]') // untested!

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Posts
    8
    Vote Rating
    0
    awhitford is on a distinguished road

      0  

    Question Panel.getTool alternative for Ext4

    Panel.getTool alternative for Ext4


    I discovered that I can get access to it like this:
    Code:
      Ext.getCmp('MyPanel').tools.refresh.hide();
    Is this a good idea or preferred to using down? (Seems easier...)

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    198
    Vote Rating
    1
    Nickname is on a distinguished road

      0  

    Default


    I think its the question what you prefer.

    I'm using "down" and "up", because event callbacks often have the clicked/event element as parameter.

    Example: Callback on a submit form button:
    first param is the btn Component and I can "walk up" to the basicForm.

    Code:
    onButtonClick: function(btn, event) {
        var form = btn.up('form').getForm();
    }
    I do not have problems with static configured ID's: Change the Id and you have to search the code, where you used Ext.getCmp on that ID.

    If you do not have a direct panel reference, that you need to use Ext.getCmp.
    But again, here I prefer using the ComponentQuery way with Ext.ComponentQuery.query
    Last edited by Nickname; 11 Jun 2011 at 2:20 PM. Reason: added last sentence

  5. #5
    Sencha User
    Join Date
    Jun 2008
    Posts
    138
    Vote Rating
    7
    jchau is an unknown quantity at this point

      0  

    Default


    so why doesn't Sencha just add back getTool instead of making more work for us?

Thread Participants: 2