参考以下的实现
- var table = sheet.tables.add("tableRecordds", 20, 1, 4, 4, spreadNS.Tables.TableThemes.light6);
- table.autoGenerateColumns(false);
- var tableColumn1 = new spreadNS.Tables.TableColumn();
- tableColumn1.name("DESCRIPTION");
- tableColumn1.dataField("description");
- var tableColumn2 = new spreadNS.Tables.TableColumn();
- tableColumn2.name("QUANTITY");
- tableColumn2.dataField("quantity");
- var tableColumn3 = new spreadNS.Tables.TableColumn();
- tableColumn3.name("AMOUNT");
- tableColumn3.dataField("amount");
- table.bindColumns([tableColumn1, tableColumn2, tableColumn3]);
- table.bindingPath("records");
- table.showFooter(true);
- table.setColumnName(3, "TOTAL");
- table.setColumnValue(2, "TOTAL DUE");
- table.setColumnDataFormula(3, "=[@QUANTITY]*[@AMOUNT]");
- table.setColumnFormula(3, "=SUBTOTAL(109,[TOTAL])");
复制代码 具体示例:https://demo.grapecity.com.cn/sp ... able-binding/purejs
|