Ribbon.SelectedItem

Syntax

SelectedItem: PP.Ui.RibbonCategory

Description

The SelectedItem property sets the active tab of tool ribbon.

Comments

Use the setSelectedItem method to set the property value from JSON, and the getSelectedItem method to return the property value.

Example

To execute the example, the page must contain the Ribbon component named "ribbon" (see Example of Positioning the Ribbon Component from JSON). The example is executed in the browser console. Add a new tab to the tool ribbon:

// Add a new tab
ribbon.beginUpdate();
ribbon.addCategory(new PP.Ui.RibbonCategory({
    Caption: "New tab"
}));
ribbon.endUpdate();

Go to the added tab. Get the active tab caption of the application ribbon:

// Get the active tab caption of the application ribbon
console.log("Active tab caption: " + ribbon.getSelectedItem().getCaption());

As a result the console displays active tab heading:

Active tab heading: New tab

See also:

Ribbon