-
24 Feb 2011 9:03 AM #1
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:
I would like to get the tool item with the id "toolRefresh". I´ve triedPHP Code:xtype: 'panel',
region: 'west',
collapsible: true,
collapseFirst: false,
flex: 0.35,
autoScroll: true,
id: 'lvPanel',
title: 'My Title',
tools: [
{
xtype: 'tool',
type: 'gear',
handler: function(e, target, panelHeader, tool){
var portlet = panelHeader.ownerCt,
el = portlet.getEl();
// simulate some gear activity
el.mask('Working...');
Ext.defer(el.unmask, 2000, el);
}
},
{
xtype: 'tool',
type: 'refresh',
id: 'toolRefresh'
}
],
- Ext.ComponentQuery.query('#toolRefresh')
- Ext.ComponentQuery.query('#lvPanel #toolRefresh') and
- Ext.ComponentQuery.query('#lvPanel .tool')
Querying
- Ext.ComponentQuery.query('.tool')
-
24 Feb 2011 11:26 PM #2
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')Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
26 Feb 2011 2:04 PM #3
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
-
Ext.ComponentQuery.query() not working
By ashish01 in forum Sencha Touch 1.x: DiscussionReplies: 3Last Post: 7 Sep 2012, 4:45 AM -
[OPEN-759] Ext.ComponentQuery.query() Epic Fail!
By gcallaghan in forum Sencha Touch 1.x: BugsReplies: 0Last Post: 3 Feb 2011, 5:50 PM -
this.tools for FormPanel returning as Object sometimes and as an Array other times
By chbfiv in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 20 Oct 2009, 2:55 PM -
Array.sortDates ,Array.unique, and extended Array.indexOf
By wm003 in forum Ext 2.x: User Extensions and PluginsReplies: 3Last Post: 4 May 2008, 12:38 AM


Reply With Quote