Hi Tom,
Thanks for contacting Syncfusion support.
Yes, you can achieve your requirement “Collapse all the header and content panel” using “collapseAll()” method. You need to set the ejAccoridon’s, Collapsible property value to true to enable the collapsible state of the Accordion. Please refer to the following code snippet.
[view]
@Html.EJ().Accordion("basicAccordion").Items(data =>
{
data.Add().Text("Data1").ContentTemplate(@<div>Content1</div>);
data.Add().Text("Data2").ContentTemplate(@<div>Content2</div>);
data.Add().Text("Data3").ContentTemplate(@<div>Content3</div>);
}).Collapsible(true).ClientSideEvents(a => a.Create("create"))
[script]
function create(args) {
acrdnObj = $("#basicAccordion").data("ejAccordion");
acrdnObj.collapseAll();
}
|
To know more about Accordion properties, methods and events, please refer to the link: http://help.syncfusion.com/js/api/ejaccordion
To know more about getting started with Accordion, refer to: http://help.syncfusion.com/aspnetmvc/accordion/overview
Regards,
Francis Paul A.