PDA

View Full Version : How to know which accordion panel is activated



Yemi
21 Aug 2013, 9:01 AM
I have a panel with a leftpanel and a right panel and a toolbar on top, the leftpanel has two accordion (acc1,acc2), I have a botton on the top toolbar which needs to know which one is active, how do I achieve this ?

Yemi
22 Aug 2013, 3:27 AM
Any ideas please ?

willigogs
22 Aug 2013, 4:11 AM
Have you tried debugging when switching between the accordion panels to see what properties change which you could then interrogate?

Yemi
22 Aug 2013, 4:34 AM
will give it a try

slemmon
23 Aug 2013, 8:35 AM
The parent panel with the accordion layout will have an items (http://docs-origin.sencha.com/extjs/3.4.0/#!/api/Ext.Panel-property-items) property which is a MixedCollection (http://docs-origin.sencha.com/extjs/3.4.0/#!/api/Ext.util.MixedCollection). That mixed collection has an each (http://docs-origin.sencha.com/extjs/3.4.0/#!/api/Ext.util.MixedCollection-method-each) method which will iterate over the items so you can check properties on them. Each panel will have a collapsed (http://docs-origin.sencha.com/extjs/3.4.0/#!/api/Ext.Panel-property-collapsed) property you can check for.

Yemi
23 Aug 2013, 12:59 PM
Thanks Slemmon. That should work