主要代码:
- var config = JSON.parse(JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig));
- var newPasteCommand = GC.Spread.Sheets.Designer.getCommand(GC.Spread.Sheets.Designer.CommandNames.DesignerPasteAll);
- if(newPasteCommand){
- var oldExecute = newPasteCommand.execute;
- newPasteCommand.execute = function(context, propertyName, args){
- //添加confirm逻辑
- alert("粘贴");
-
- oldExecute.call(this, context, propertyName, args)
- }
- }
- config.commandMap = {};
- config.commandMap[GC.Spread.Sheets.Designer.CommandNames.DesignerPasteAll] = newPasteCommand;
- var d = new GC.Spread.Sheets.Designer.Designer(document.getElementById("gc-designer-container"), config);
复制代码
完整代码请参考附件demo
|
|