当我在SpreadJs中设置单元格的填充,然后在行上自动调整大小时,单元格将缩小到填充的大小。
如果我没有设置填充,那么单元格会自动调整到标准大小,这是我希望发生的事情。
我希望单元格的标准大小比默认值有更多的填充,这是可能的,但自动调整大小作为默认值工作,而不是缩小单元格?
发布于 2019-04-11 14:27:53
关于我的问题,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));
}
https://stackoverflow.com/questions/55588196
复制相似问题