Articles in this section
Category / Section

How to get active Tab element text in Ribbon?

1 min read

The Ribbon component provides rich and customizable user interfaces such as Office 2010 and Share Point 2010. The Ribbon component’s Tab appears across the top of the page. You can get the active tab text using the selectedItemIndex property and the getTabText method. The selectedItemIndex property returns the currently opened tab index, so you can get the index and then pass it into the getTabText method to get the active Tab text in Ribbon component. The following code sample demonstrates how to get active Tab element text in Ribbon.

 

function onBtnClick() { 
    // Create an instance for Ribbon component
    var ribbonObj = $("#defaultRibbon").data("ejRibbon"); 
      // Get the active Tab text value using the selectedItemIndex property and the getTabText method
    var txt = ribbonObj.getTabText(ribbonObj.model.selectedItemIndex); 
    alert("The active tab text is '" + txt + "'."); 
} 

 

Sample: https://jsplayground.syncfusion.com/mhol3poz

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied