setWbkMd (report, callback);
report. Sets the report, modified settings of which should be sent to server.
callback. Sets callback function to get report metadata.
The setWbkMd method sets metadata to report object.
This method returns True if the settings have been sent to the server.
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 also add the following code in the handler, that processes document opening event:
var loadWbkMdButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Set metadata", //Title Click: PP.Delegate(onClickLoadWbkMd) }); function onClickLoadWbkMd() { //Set metadata to workbook var changes = tsService.setWbkMd(wbk, PP.Delegate(onWbkMd, this)); // loadWbkMd method execution end event handler function onWbkMd(sender, args){ //Add check button: whether settings are sent to server var checkButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Check", //Title Click: PP.Delegate(onClickCheck) }); function onClickCheck(){ //Clicking the button outputs message about sending settings alert(changes); } } }
After executing the example a button named Set Metadata is placed in the HTML page. On clicking this button metadata is set to the report object, and a button named Check is created to check if the data is sent to server. Click this button to get the result of checking if the settings are sent to the server.
See also: