Activate tabitem by Javascript

How can i activate a specific tabitem from clientside? 

1 Reply

KV Karthikeyan Viswanathan Syncfusion Team February 27, 2017 06:22 AM UTC

Hi Danferd Lan   
   
Thanks for contacting Syncfusion Support.   
   
Yes, you can select the tab items using showItem public method in client side.   
   
Please find the code snippet:   
   
<code>   
   
<ej:Tab ID="DefaulttabContent" runat="server" Width="600px"ShowCloseButton="true">   
        
</ej:Tab>   
   
</code>   
<code>   
   
<script type="text/javascript">   
        function tabselect(args) {   
            var inst = $('#<%=DefaulttabContent.ClientID%>').ejTab("instance");   
            inst.showItem(2);   
            // you can also use selectedItemIndex   
            //inst.option("selectedItemIndex",2)   
        }   
    </script>   
</code>   
  
   
Refer to the API reference link for selectedItemIndex: https://help.syncfusion.com/api/js/ejtab#members:selecteditemindex    
   
Refer to the showItem  client side public method link: https://help.syncfusion.com/api/js/ejtab#methods:showitem    
   
     
Regards,    
Karthikeyan V.    


Loader.
Up arrow icon