您好,只能通过遍历每个Cell去实现您的需求,请参考以下代码:
- window.onload = function () {
- let designerConfig = JSON.parse(
- JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig)
- );
- let designer = new GC.Spread.Sheets.Designer.Designer(
- "gc-designer-container",
- designerConfig
- );
- let spread = designer.getWorkbook();
- let sheet = spread.getActiveSheet();
- sheet.getCell(0, 0).value("Hello World");
- sheet.options.isProtected = true;
- sheet.getCell(0, 0).locked(false);
- let range = sheet.getRange(0, 0, sheet.getRowCount(), sheet.getColumnCount());
- for (let i = range.row; i < range.row + range.rowCount; i++) {
- for (let j = range.col; j < range.col + range.colCount; j++) {
- if (!spread.getActiveSheet().getActualStyle(i, j).locked) {
- console.log(`(${i},${j})`);
- }
- }
- }
- };
复制代码 |