是这么设置canUndo的,无效
var ribbonFileCommands = {
'setIdentifier_1': {
canUndo: true,
text: '^',
title: '竖加正确',
commandName: 'setIdentifier_1',
execute: (context) => {
var sheet = context.Spread.getActiveSheet();
var row = sheet.getActiveRowIndex();
var col = sheet.getActiveColumnIndex();
var cell = sheet.getCell(row, col);
if (cell.locked()) {
bdoInfoBox('提示', '您试图更改的单元格或图表位于受保护的工作表中。不允许修改。');
return;
}
cell.text('^').foreColor('red');
var ftb = GC.Spread.Sheets.FormulaTextBox.findControl(document.getElementsByClassName("formula-bar-item formulaBarText")[0])
ftb.refresh(true);
}
}
}
var ribbonFileConfigIdentifier = {
'label': '审计标识符',
'thumbnailClass': 'ribbon-thumbnail-spreadsettings-identifier',
'commandGroup': {
'children': [{
'direction': 'vertical',
'commands': ['setIdentifier_1']
}]
}
};
var designerConfig = GC.Spread.Sheets.Designer.DefaultConfig;
// 新增菜单栏
var bdoRibbon = {
'id': 'bdo',
'text': '立信',
'buttonGroups': []
};
bdoRibbon.buttonGroups.push(ribbonFileConfigIdentifier);
designerConfig.commandMap = {};
Object.assign(designerConfig.commandMap, ribbonFileCommands);
designerConfig.ribbon.push(bdoRibbon);
|