您好,关于批注的问题回复如下:
1、批注的角标是以Excel为标准设计的,没有提供修改颜色的接口,想了解一下您要改变颜色的应用场景是什么?
2、可以用事件来实现,请参考下列代码:
- var spread = GC.Spread.Sheets.findControl("ss");
- var sheet = spread.getActiveSheet();
- sheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e, info) {
- var sheet = info.sheet;
- var newSelections = info.newSelections;
- if(newSelections || newSelections.length === 1){
- var sel = newSelections[0];
- var row = sel.row;
- var col = sel.col;
- var rowCount = sel.rowCount;
- var colCount = sel.colCount;
- var span = sheet.getSpan(row, col);
- if((!span && rowCount === 1 && colCount === 1) || (span && span.rowCount === rowCount && span.colCount === colCount)){
- sheet.suspendPaint();
- sheet.comments.all().forEach(function(comt){
- comt.displayMode(GC.Spread.Sheets.Comments.DisplayMode.hoverShown);
- });
- var comt = sheet.comments.get(row, col);
- if(comt){
- comt.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
- }
- sheet.resumePaint();
- }
- }
- });
复制代码 |