It's possible to overcome the issue by preventing the expansion of the next or the previous panel of the panel that is being collapsed, as shown below on line 39.
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<script type="text/javascript">
Ext.layout.container.Accordion.override({
onComponentCollapse: function (comp) {
var me = this,
owner = me.owner,
toExpand,
expanded,
previousValue;
if (me.owner.items.getCount() === 1) {
// do not allow collapse if there is only one item
return false;
}
if (!me.processing) {
me.processing = true;
previousValue = owner.deferLayouts;
owner.deferLayouts = true;
toExpand = comp.next() || comp.prev();
// If we are allowing multi, and the "toCollapse" component is NOT the only expanded Component,
// then ask the box layout to collapse it to its header.
if (me.multi) {
expanded = me.owner.query('>panel:not([collapsed])');
// If the collapsing Panel is the only expanded one, expand the following Component.
// All this is handling fill: true, so there must be at least one expanded,
if (expanded.length === 1) {
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//Allows the panel to be collapsed without expand the next or the previous one
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//toExpand.expand();
}
} else if (toExpand) {
toExpand.expand();
}
owner.deferLayouts = previousValue;
me.processing = false;
}
}
});
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Panel Margin="10" Title="Accordion" Width="250" Height="200" Icon="ApplicationTileVertical" Layout="Accordion" runat="server">
<LayoutConfig>
<ext:AccordionLayoutConfig Multi="true" />
</LayoutConfig>
<Items>
<ext:Panel Title="Ext" runat="server" />
<ext:Panel Title="Net" runat="server" />
<ext:Panel Title="Ext.Net" runat="server" />
</Items>
</ext:Panel>
</body>
</html>