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.

Set Selected Tab in JavaScript

Thread ID:

Created:

Updated:

Platform:

Replies:

119741 Jul 27,2015 12:38 PM Jul 29,2015 12:11 AM JavaScript 3
loading
Tags: ejTab
vicebetancourt
Asked On July 27, 2015 12:38 PM

I want change the selected tab using javascript

$("#tabPeople").ejTab();

<div id="tabPeople" style="display: none">
                        <ul>
                            <li><a rel='nofollow' href="#admins">Admins</a></li>
                            <li><a rel='nofollow' href="#doc">Doctors</a></li>
                            <li><a rel='nofollow' href="#teachers">Teachers</a></li>
                        </ul>
                        <div id="admins"></div>
                        <div id="admins"></div>
                        <div id="admins"></div>
</div>

Sasikala Nagarajan [Syncfusion]
Replied On July 28, 2015 07:51 AM

Hi Vicente,
Thanks for using Syncfusion products,

I want to change the selected tab using javascript

We can achieve your requirement using our existing property selectedItemIndex. This API is used to set the active header based on the given index value.

Please refer the below code snippet to set the selected Item Index during Initialization.

[script]


$(function () {

// declaration

$("#defaultTab").ejTab({selectedItemIndex:2});
});


Also, we can change the selected Item Index after initializing the tab control. We can achieve this using object of tab control. Please refer the below code snippet to set selected Item Index using object of the tab control.

[script]


$("#tabPeople").ejTab();


tabObj = $("#tabPeople").data("ejTab");
tabObj.option("selectedItemIndex",2);


We have prepared the sample based on this. Please check with the below link

http://jsplayground.syncfusion.com/cutp4hws

Also please refer the below link to know more about controls and its available properties ,methods and events.

http://helpjs.syncfusion.com/js/overview

Please check with the given links and let us know if you need any further assistance.

Regards,
Sasikala Nagarajan

vicebetancourt
Replied On July 28, 2015 03:24 PM

Thanks!, it works. You're a legend.

Regards


Sasikala Nagarajan [Syncfusion]
Replied On July 29, 2015 12:11 AM

Hi Vicente,
Thanks for the update,
Please get back to us if you need any further assistance,
Regards,
Sasikala Nagarajan

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.

;