您好,获取绑定单元格信息的示例代码我贴在这里,请参考:
- var spread = GC.Spread.Sheets.findControl("ss");
- function ngAfterViewInit() {
- // // 工作簿
- const source = new GC.Spread.Sheets.Bindings.CellBindingSource({});
- spread.getActiveSheet().setDataSource(source);
- getBindingPathKeys();
- }
- function getBindingPathKeys() {
- const sheet = spread.getActiveSheet();
- sheet.suspendPaint();
- const rowCount = sheet.getRowCount();
- const columnCount = sheet.getColumnCount();
- let bindingPathKey;
- const bindingPathArray = [];
- for (let i = 0; i < rowCount; i++) {
- for (let j = 0; j < columnCount; j++) {
- bindingPathKey = sheet.getBindingPath(i, j);
- if (bindingPathKey) {
- bindingPathArray.push({
- bindingPath: bindingPathKey,
- row:i,
- col:j
- });
- }
- }
- }
- sheet.resumePaint();
- console.log(bindingPathArray);
- }
- ngAfterViewInit();
复制代码 |