Renganathan M G
Renganathan M G

Reputation: 5209

Collapse all the panels in the accordion by default in extjs 4

I want to collapse all the panels in the accordion by default. For me first panel always active.

Guys please suggest how to fix the problem?

Upvotes: 3

Views: 7273

Answers (5)

Kamalakar Reddy
Kamalakar Reddy

Reputation: 1

In Accordian layout create one dummy collpased panel like

{
    xtype: 'panel', // << fake hidden panel
    hidden: true,
    collapsed: false
}

For Example In accordian layout items

{
    xtype: 'panel', // << fake hidden panel
    hidden: true,
    collapsed: false
},{
    xtype:'panel',
    title:''Panle1'
},{
   xtype:'panel',
   title:''Panle2'
}

This should work.

Upvotes: 0

Daniel-san
Daniel-san

Reputation: 56

In ExtJS 4.2.1 you can add an extra panel, set it as hidden but expanded. You'll now be able to close all the visible panels. NOTE: This doesn't work in ExtJS 4.2.2

Upvotes: 4

&#194;nderson Soares
&#194;nderson Soares

Reputation: 69

Using ExtJs 4.2.2,

collapsed: true

in all panels, except the one you want expanded (so collapsed: false)

It's working for sure, code tested.

Upvotes: 2

Jim Sandridge
Jim Sandridge

Reputation: 1

In extjs 3.2.1 at least, simply set the property

collapsed : true

on each of the panels in your accordion layout.

Upvotes: -1

Davor Zubak
Davor Zubak

Reputation: 4746

I believe this is not possible, but if you need this config for visual purpose, you can create a aditional, content empty panel, and put it as a last item in accordian, and make it first to expand by default, this way you can imitate all collapsed state! Cheers!

Upvotes: 0

Related Questions