TSService.refreshWbk

Syntax

refreshWbk (report, callback);

Parameters

report. Sets object

callback. Sets handler for operation execution end.

Description

The refreshWbk method refreshes a workbook.

Example

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

var wbkDataBox = workbookBox.getDataView();
var setHorizontalButt = new PP.Ui.Button({
	ParentNode: document.body, //DOM parent node
	Content: "Change Display Mode", //text
	Click: PP.Delegate(onClickSetHorizontal)
});
function onClickSetHorizontal(){
	//Get a component used to control workbook view position
	var modeSelector = wbkDataBox.getModeSelectorView();
	//Get metadata of the selected mode change
	var pos;
	if (wbk.getActiveSheet().getMetadata().windowsPosition == "Horizontal")
		{
			pos = modeSelector.getModeSelectorState(PP.TS.Ui.ModeSelectorType.Vertical);
		}
	else
		{
			pos = modeSelector.getModeSelectorState(PP.TS.Ui.ModeSelectorType.Horizontal);
		}
	//Get workbook metadata
	var md = wbk.getMetadata();
	//Set metadata of the selected mode change to workbook metadata
	for (var prop in pos){
		md[prop] = pos[prop];
	}
	//Refresh workbook
	tsService.refreshWbk(wbk, PP.Delegate(function(){
		wbkDataBox.refreshAll();
	}));
}

After executing the example the Change Display Mode button is placed in HTML page. Clicking this button changes workbook display mode.

See also:

TSService