WbkRibbonView.getMainCategory

Syntax

getMainCategory ();

Description

The getMainCategory method returns the Home tab in workbook ribbon.

Comments

This method returns an object of the WbkRibbon class.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:

//Get the Ribbon component
var ribbonView = workbookBox.getRibbonView();
				
//Get the Home workbook tool ribbon tab
var mainCategory = ribbonView.getMainCategory();
				
var mainCategoryButt = new PP.Ui.Button({
ParentNode: document.body, //DOM parent node
Content: "Home", //Text      
Click: PP.Delegate(onClickMainCategory)     
}); 
var state = False;
function onClickMainCategory()
{
//Show or hide the Home workbook tool ribbon tab.
state ?  mainCategory.hide() :  mainCategory.show();
state = !state;
}

After executing the example the Home button is added to the page. Clicking this button hides or shows the Home tab in workbook ribbon.

See also:

WbkRibbonView