We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Accordion closed on load

Thread ID:

Created:

Updated:

Platform:

Replies:

121797 Jan 26,2016 08:01 AM Jan 27,2016 05:37 AM ASP.NET MVC 1
loading
Tags: Accordion
Tom Bakker
Asked On January 26, 2016 08:01 AM

I would like my accordion to be fully closed on load. Is this achievable? My project uses MVC4.

Francis Paul Antony Raj [Syncfusion]
Replied On January 27, 2016 05:37 AM

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.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;