请参考附件demo,主要代码如下:- var InsertPictureCommand = GC.Spread.Sheets.Designer.getCommand(GC.Spread.Sheets.Designer.CommandNames.InsertPicture);
- if(InsertPictureCommand){
- var oldExecute = InsertPictureCommand.execute;
- InsertPictureCommand.execute = function(context, propertyName, args){
- //添加自定义逻辑
- alert("添加图片")
- oldExecute.call(this, context, propertyName, args);
- }
- }
- var config = GC.Spread.Sheets.Designer.DefaultConfig;
- config.commandMap = {};
- config.commandMap[GC.Spread.Sheets.Designer.CommandNames.InsertPicture] = InsertPictureCommand;
- var designer = new GC.Spread.Sheets.Designer.Designer("gc-designer-container", config, undefined);
复制代码
|
|