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. Image for the cookie policy date
close icon

Getting selectedItemIndex from ejAccordion

Hello,

Can someone post a code snippet showing how to get the selectedItemIndex from ejAccordion when it changes?  I am trying to use the activate event without success.

Below is the code I am using.  The activate event does not seem to fire.  The console will show the selectedItemIndex when the page loads but not when the active accordion item changes.

Thanks,  Randy

<script>

 

    var accrdnObj;

 

    $(function () {

        $('#courseGroupAccordion').ejAccordion({

            activate: function(){

                accordionChange();

            },

            enableAnimation: false,

            showRoundedCorner: true

        });

        acrdnObj = $("#courseGroupAccordion").data("ejAccordion");

        var index = acrdnObj.option("selectedItemIndex");

        console.log('selectedItemIndex: ' + index);

    });

   

    function accordionChange() {

        debugger;

        var index = acrdnObj.option("selectedItemIndex");

        console.log('selectedItemIndex: ' + index);

    }

 

</script>


3 Replies

GS Gobalakrishnan S Syncfusion Team February 10, 2015 01:22 PM UTC

Hi Randy,

We are unable to reproduce the reported issue. We have checked with provided code snippet in our end and we are able to get the selected Item index in the activate event. We have prepared a sample with your code snippet. It can be download from the following location:

http://www.syncfusion.com/downloads/support/directtrac/118144/Accordion-1850371764.zip

Please check with above sample. If still you face any difficulties please get back to us with additional information regarding this issue. We will happy to assist you.

Regards,

Gobalakrishnan S




RC Randy Craven February 10, 2015 07:31 PM UTC

Thank you Gobalakrishnan, for this reply.  I can see that your example does fire the activate event.

I'll review my code again to see if I can determine the cause and reply back if I need help.

Thanks again,
Randy


GS Gobalakrishnan S Syncfusion Team February 12, 2015 05:44 AM UTC

Hi Randy,

Thanks for your update.

Please check in your end .if you face any difficulties then please get back to us, we will assists you gladly.

Regards,

Gobalakrishnan S



Loader.
Live Chat Icon For mobile
Up arrow icon