zhangweicheng 5 lat temu
rodzic
commit
d824e2e2d8
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5 4
      public/web/sheet/sheet_common.js

+ 5 - 4
public/web/sheet/sheet_common.js

@@ -292,13 +292,14 @@ var sheetCommonObj = {
             if (setting.header[col].formatter) {
                 sheet.setFormatter(-1, col, setting.header[col].formatter, GC.Spread.Sheets.SheetArea.viewport);
             }
-            if(setting.headRows != 2 &&  setting.header[col].cellType === "checkBox"||setting.header[col].cellType === "button"){//clear and reset   2019 - 11- 11 加入了多行列头的判断情况,排除多行列头时清空操作,先试运行看是否有问题
+            /* 直接在showrowdata时当val为null时返回一个text类型的单元格 
+              if(setting.headRows != 2 &&  setting.header[col].cellType === "checkBox"||setting.header[col].cellType === "button"){//clear and reset   2019 - 11- 11 加入了多行列头的判断情况,排除多行列头时清空操作,先试运行看是否有问题
                 var me = this, header = GC.Spread.Sheets.SheetArea.colHeader;
                 sheet.deleteColumns(col,1);
                 sheet.addColumns(col, 1);
                 sheet.setValue(0, col, setting.header[col].headerName, header);
                 sheet.setColumnWidth(col, setting.header[col].headerWidth?setting.header[col].headerWidth:100);
-            }
+            } */
             if(setting.header[col].visible!==null&&setting.header[col].visible!==undefined){
                 sheet.setColumnVisible(col,setting.header[col].visible);
             }
@@ -350,7 +351,7 @@ var sheetCommonObj = {
                     val =val+'';
                 }
             }
-            if(val!=null&&setting.header[col].cellType === "checkBox"){
+            if(setting.header[col].cellType === "checkBox"){
                 this.setCheckBoxCell(row,col,sheet,val)
             }
             if(setting.header[col].cellType === "comboBox"){
@@ -483,7 +484,7 @@ var sheetCommonObj = {
         }
     },
     setCheckBoxCell(row,col,sheet,val){
-        var c = this.getCheckBox();
+        var c = val==null?new GC.Spread.Sheets.CellTypes.Text():this.getCheckBox();
         sheet.setCellType(row, col,c,GC.Spread.Sheets.SheetArea.viewport);
         sheet.getCell(row, col).value(val);
         sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);