可以用下面的代码设置
var spread = GC.Spread.Sheets.Designer.findControl('gc-designer-container').getWorkbook();
GC.Spread.Sheets.Designer.getCommand("backColor").enableContext = 'test'
var newFun = GC.Spread.Sheets.Designer.getCommand("backColor")
var config = GC.Spread.Sheets.Designer.DefaultConfig
config.commandMap = {
"backColor":newFun
}
var designer = GC.Spread.Sheets.Designer.findControl('gc-designer-container');
designer.setConfig(config)
designer.setData("test",true)
前景色也是同理,前景色对应的命令是foreColor
|