ServerSheetControl.batch Method
Apply serializable compatibility commands atomically.
Owner: ServerSheetControl. Package: @txtextcontrol/tx-sheet-control-server. Version: 2.0.0.
Syntax
owner.batch(commands)
Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---|
commands | readonly WorkbookCommand[] | No | Operation-specific input; see the owning type for units and scope. |
Return Value
unknown[].
A detached result or a handle bound to the same worksheet.
Examples
Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.
function demonstrateServerSheetControlBatch(control) {
const book = control.workbook;
control.batch([
{ method: 'setCell', args: ['B8', 120] },
{ method: 'setCell', args: ['B9', 80] },
{ method: 'setCell', args: ['B10', '=SUM(B8:B9)'] },
]);
console.log(book.sheets.at(0).cell('B10').value);
}
Remarks
Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.