ExtJS accordion setActiveItem

I am developing an application using ExtJS. I have an Accordion and you need to select the active element (so that it expands). Accordion.setActiveItem displays the following:

"setActiveItem" is not a function in a browser error window.

The second problem is that the hideCollapseTool property, when set to true during initialization, does nothing. Collapse tools are shown.

I am using ExtJS 3.1.1. I would be very grateful for any advice and answers.

+4
source share
5 answers

I'm out of luck with setActiveItem . Studying it in Firebug, the accordion panel does not even have this method.

What I did to get around this was to call expand() on the element I want to focus, for example

 accordion.items.itemAt(2).expand(); 
+6
source

You can also expand an element in the accordion panel using this component identifier as follows:

 Ext.getCmp('myAccordion').expand(); Ext.getCmp('myAccordion').items.key('myAccordionPanel').expand(); 
+2
source

I fixed it in the controller using referverview link

 this.getUserview().items.items[1].expand(); 
+2
source
 Ext.getCmp('myAccordion').getLayout().setActiveItem(0); // First Child Ext.getCmp('myAccordion').getLayout().setActiveItem(1); // 2nd Child and so on 
+1
source

I spent 6 hours fighting with him. Collapse () and expand () don't seem to work. I would expand the panel under the accordion, and other panels would break.

Finally, it turned out that there is some kind of problem that occurs if your accordion is hidden, and then you show () it right before the collapse () and expand () operations on the sub-panels.

My workaround was to never set the accordion to "hidden = true" and never show () it. Instead, I started using the style = {opacity: 0}, and then set opacity: 100 when I needed to see it. This fixed everything, but not the most elegant solution.

0
source

All Articles