漏了一个样式赋值
miou
注册会员 / 发表于:昨天 18:479#
设置单元格样式为只读
var sheet = spread.getActiveSheet()
var style = new GC.Spread.Sheets.Style();
style.locked = true;
style.cellButtons = [
{
useButtonStyle: false,
imageType: GC.Spread.Sheets.ButtonImageType.custom,
imageSrc: "https://img0.baidu.com/it/u=3101694723,748884042&fm=26&fmt=auto&gp=0.jpg",
imageSize: {
height: 15,
width: 15
},
enabled: false
}
];
var defaultStyle = new GC.Spread.Sheets.Style();
defaultStyle.locked = false;
sheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport);
sheet.addNamedStyle(style);
sheet.setStyle(1,1,style);
sheet.options.isProtected = true;
|