loadWbkMd (report, callback);
report. Sets object to load metadata.
callback. Sets callback function.
The loadWbkMd method loads metadata to report object.
To execute the example, the page must contain the WorkbookBox component named workbookBox and the service used to work with time series named tsService (see Example of Creating the WorkbookBox Component), and several data views must be selected in the working area. Next add the following code in the event hander that processes document opening:
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 component for controlling workbook view position var modeSelector = wbkDataBox.getModeSelectorView(); //Get metadata of changing the selected mode 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 for changing the selected mode to workbook metadata for (var prop in pos){ md[prop] = pos[prop]; } //Refresh workbook tsService.loadWbkMd(wbk, PP.Delegate(function(){ wbkDataBox.refreshAll(); })); }
After executing the example the Change Display Mode button is placed in HTML page. Clicking this button changes data views display mode. If the views were arranges vertically, they will be arranged vertically, and vice versa.
See also: