PDA

View Full Version : [CLOSED] Accordion ActiveIndex



Adrian
Apr 12, 2012, 2:20 AM
Hi
When working with the Accordion Layout, setting Collapsed = true/false in Markup, or setting ActiveIndex in code-behind are not working.

Adrian.

Daniil
Apr 12, 2012, 9:17 AM
Hi,

A panel you wish to be expanded should have

collapsed : false
explicitly on client.

But we don't render

Collapsed="false"
because it's be default.

We should review it to support AccordionLayout.

For now, you can set up the "collapsed" config option via CustomConfig.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Panel
runat="server"
Width="500"
Height="500"
Layout="AccordionLayout">
<Items>
<ext:Panel
runat="server"
Title="Panel 1"
BodyStyle="background-color: green;" />
<ext:Panel
runat="server"
Title="Panel 2"
BodyStyle="background-color: yellow;">
<CustomConfig>
<ext:ConfigItem Name="collapsed" Value="false" Mode="Raw" />
</CustomConfig>
</ext:Panel>
</Items>
</ext:Panel>
</form>
</body>
</html>

Adrian
Apr 13, 2012, 10:34 PM
Thanks for the explanation Daniil.

Adrian.

Daniil
Feb 11, 2013, 11:47 AM
With the latest Ext.NET sources (SVN trunk and the next release v2.2) it is possible to replace

<ext:Panel
runat="server"
Title="Panel 2"
BodyStyle="background-color: yellow;">
<CustomConfig>
<ext:ConfigItem Name="collapsed" Value="false" Mode="Raw" />
</CustomConfig>
</ext:Panel>
with

<ext:Panel
runat="server"
Title="Panel 2"
BodyStyle="background-color: yellow;"
Collapsed="false" />