getAddColumnsSettings (wbk, columns);
wbk. Sets workbook value.
columns. Sets table columns.
The getAddColumnsSettings method returns body of a request to add columns to a workbook.
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:
var getAddColumnsSettingsButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content:"Add Column", //Text Click: PP.Delegate(onClickGetAddColumnsSettings) }); function onClickGetAddColumnsSettings() { var wbk = workbookBox.getSource();//return an instance of the PP.TS.WbkDocument class var columns = [{ k: 10, type: "Scenario", vis: True, readOnly: False }]; //Get body of request for adding columns to workbook var body = tsService.getAddColumnsSettings(wbk, columns); wbk.setIsChanged(True); tsService._invokeRemoteProc(wbk, body, function() { workbookBox.refreshAll(); }); }
After executing the example a button named Add Column is placed on the HTML page. On clicking this button a new column named Scenario is added to the workbook.
See also: