Selaa lähdekoodia

spreadjs,customizeCombo允许定义多个

MaiXinRong 5 vuotta sitten
vanhempi
commit
73bed39f16
1 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 5 4
      app/public/js/spreadjs_rela/spreadjs_zh.js

+ 5 - 4
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -441,12 +441,13 @@ const SpreadJsObj = {
             sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType.unit);
         }
         if (colSetting.cellType === 'customizeCombo') {
-            if (!sheet.extendCellType.unit) {
-                sheet.extendCellType.unit = this.CellType.getCustomizeComboCellType(colSetting.comboItems);
+            const cellKey = colSetting.cellTypeKey ? 'customizeCombo-' + colSetting.cellTypeKey : 'customizeCombo';
+            if (!sheet.extendCellType[cellKey]) {
+                sheet.extendCellType[cellKey] = this.CellType.getCustomizeComboCellType(colSetting.comboItems);
                 if (!sheet.AcitveComboRefresh) {
                     sheet.bind(spreadNS.Events.LeaveCell, function (e, info) {
                         const cellType = info.sheet.getCell(info.row, info.col).cellType();
-                        if (cellType === sheet.extendCellType.unit) {
+                        if (cellType === sheet.extendCellType[cellKey]) {
                             info.sheet.leaveCell = {row: info.row, col: info.col};
                         } else {
                             delete info.sheet.leaveCell;
@@ -460,7 +461,7 @@ const SpreadJsObj = {
                     sheet.AcitveComboRefresh = true;
                 }
             }
-            sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType.unit);
+            sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType[cellKey]);
         }
         if (colSetting.formatter) {
             sheet.getRange(-1, col, -1, 1).formatter(colSetting.formatter);