WbkDataView.setActiveSheet

Syntax

setActiveSheet (keyOrId, reInit);

Parameters

keyOrId. Sheet key or ID.

reInit. Indicates whether active sheet must be forcefully changed regardless of the current state. If the parameter is set to True, the sheet must be changed, False - it is not necessary to change the sheet.

Description

The setActiveSheet method sets key of an active sheet.

Example

To execute the example, the page must contain the WbkDataBox component named wbkDataBox (see WbkDataBox Constructor) and the workbook with the 806723 key, also the following code must be added in the document opening event handler:

//Create the Change Sheet button to show work of the setActiveSheet() method
var actShButt = new PP.Ui.Button({
	ParentNode: 'example', //DOM parent node
	Content: "Change Sheet", //text
	Click: PP.Delegate(onClick)
});
//declare dummy variable
var shCount = 1;
//Handler of the Change Sheet button click event
function onClick() {
	if(shCount <=3)
		{
			wbkDataBox.setActiveSheet(shCount, False);
			shCount++;
		}
	else
		{
			shCount = 1;
			wbkDataBox.setActiveSheet(shCount, False);
		}

After executing the example the HTML page will contain the Change Sheet button, clicking which changes the active sheet.

See also:

WbkDataView