PDA

View Full Version : using Ext.ComponentQuery.query in 'this' and not scan whole app



delp
29 Oct 2013, 3:42 AM
I've seen quite a few examples for using Ext.ComponentQuery.query and from what I can see it scans the whole appliaction for whatever parameters you give it.

I have say a custom panel (say Class A) that has inside it another panel (say itemId=myPanel) and button. Now the application can have many tabs that are all populated by Class A's.
If I click the button I'd like to only scan 'this' to get its internal panel as all other tabs while contain an instance of the Class A which will have a panel with same item id.

any pointers?

evant
29 Oct 2013, 3:44 AM
Containers implement a queryable mixin, so you can do:



this.query(selector); // All child items under this that match
this.queryBy(fn, scope) // All child items under this that match the passed function
this.down(selector) // First child at any depth that matches
this.child(selector) // First direct child that matches

delp
29 Oct 2013, 4:22 AM
Thanks