0

当我在 SpreadJs 中设置单元格的填充,然后对行进行自动调整大小时,单元格会缩小到填充的大小。

如果我没有设置填充,那么单元格会自动调整为我想要的标准大小。

我希望单元格的标准大小比默认值稍微多一点,这是否可能,但自动调整大小作为默认值而不是缩小单元格?

在此处输入图像描述

4

1 回答 1

0

SpreadJs 支持就我的查询回复了我。

我能够将 minRowHeight 设置为自动调整高度以及我的填充以实现我想要的

// set the cell padding
const style = new GC.Spread.Sheets.Style();
style.cellPadding = "2";
sheet.setDefaultStyle(style, GC.Spread.Sheets.SheetArea.viewport);

const minRowHeight = 13;
const oldAutoFitHeight = GC.Spread.Sheets.CellTypes.Base.prototype.getAutoFitHeight;
GC.Spread.Sheets.CellTypes.Base.prototype.getAutoFitHeight = function (val, text, cellStyle, zoomFactor,
    context) {
    return Math.max(minRowHeight, oldAutoFitHeight.call(this, val, text, cellStyle, zoomFactor,
        context));
}
于 2019-04-11T14:27:52.930 回答