1. #1
    Ext JS Premium Member htammen's Avatar
    Join Date
    Jul 2010
    Location
    Germany, Hannover
    Posts
    74
    Vote Rating
    0
    htammen is on a distinguished road

      0  

    Default ComponentQuery: search tools array

    ComponentQuery: search tools array


    how can I find an item of the panels tools array via ComponentQuery?

    This is my panel:
    PHP Code:
        xtype'panel',
        
    region'west',
        
    collapsibletrue,
        
    collapseFirstfalse,
        
    flex0.35,
        
    autoScrolltrue,
        
    id'lvPanel',
        
    title'My Title',
        
    tools: [
            {
              
    xtype'tool',
              
    type'gear',
              
    handler: function(etargetpanelHeadertool){
                  var 
    portlet panelHeader.ownerCt,
                      
    el portlet.getEl();
                      
                  
    // simulate some gear activity
                  
    el.mask('Working...');
                  
    Ext.defer(el.unmask2000el);
              }
            },
            {
              
    xtype'tool',
              
    type'refresh',
              
    id'toolRefresh'
            
    }
        ], 
    I would like to get the tool item with the id "toolRefresh". I´ve tried
    • Ext.ComponentQuery.query('#toolRefresh')
    • Ext.ComponentQuery.query('#lvPanel #toolRefresh') and
    • Ext.ComponentQuery.query('#lvPanel .tool')
    Last one to get the entire tools array. Nothing worked

    Querying
    • Ext.ComponentQuery.query('.tool')
    retrieves all tool components at the page.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    58
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It works for me. Remember that query returns an array.

    I just went into the portal example and

    Ext.ComponentQuery.query('#tool-1046')

    returns an array containing the collapse tool of the grid (which is in portlet-1)

    So does Ext.ComponentQuery.query('#portlet-1 #tool-1046')

  3. #3
    Ext JS Premium Member htammen's Avatar
    Join Date
    Jul 2010
    Location
    Germany, Hannover
    Posts
    74
    Vote Rating
    0
    htammen is on a distinguished road

      0  

    Default


    I´ve downloaded PR2 today and tested again. No success.
    When I debugged I noticed that the tools array is not enclosed in the components that are browsed through so the query function cannot find the toolRefresh tool.

Similar Threads

  1. Ext.ComponentQuery.query() not working
    By ashish01 in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 7 Sep 2012, 4:45 AM
  2. [OPEN-759] Ext.ComponentQuery.query() Epic Fail!
    By gcallaghan in forum Sencha Touch 1.x: Bugs
    Replies: 0
    Last Post: 3 Feb 2011, 5:50 PM
  3. Replies: 2
    Last Post: 20 Oct 2009, 2:55 PM
  4. Array.sortDates ,Array.unique, and extended Array.indexOf
    By wm003 in forum Ext 2.x: User Extensions and Plugins
    Replies: 3
    Last Post: 4 May 2008, 12:38 AM

Thread Participants: 1