getRemoveColumnsSettings (wbk, columns);
wbk. Sets workbook value.
columns. Sets columns.
The getRemoveColumnsSettings method returns body of a request to remove workbook columns.
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 source = workbookBox.getSource();////return an instance of the PP.TS.Workbook class var columns = [{ k: 1, type: "Scenario", vis: True, readOnly: False }]; //Add columns to workbook tsService.addColumns(source, columns); var removeColumnButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Remove Column", //Text Click: PP.Delegate(onClickRemoveColumn) }); function onClickRemoveColumn() { var wbk = args.Workbook; //Get body of request for removing columns var body = tsService.getRemoveColumnsSettings(wbk, columns); wbk.setIsChanged(True); tsService._invokeRemoteProc(wbk, body, PP.Delegate(onResponse)); function onResponse(sender, args) { workbookBox.refreshAll(); } removeColumnButt.setEnabled(False); }
After executing the example a button named Remove Column is placed on the HTML page and a new column is added to the workbook table. On clicking the button the added column will be removed.
See also: