Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS accordion setActiveItem

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

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

Second issue is that hideCollapseTool property, when set to true in the initialisation, doesn't do anything. Collapse tools still are being displayed.

I am using ExtJS 3.1.1. I would be very thankful for any tips and answers.

like image 623
xsix Avatar asked Dec 22 '22 23:12

xsix


2 Answers

I have had little luck with setActiveItem myself. Examining it in Firebug, the accordion panel doesn't even have that method.

What I did to get around it was to call expand() on the item I want to have focus, e.g. :

accordion.items.itemAt(2).expand();
like image 80
Jonathan Bates Avatar answered Jan 08 '23 12:01

Jonathan Bates


You can also expand some item in an accordion panel by it's component id like this:

Ext.getCmp('myAccordion').expand();
Ext.getCmp('myAccordion').items.key('myAccordionPanel').expand();
like image 25
Lasma Sietinsone Avatar answered Jan 08 '23 13:01

Lasma Sietinsone