本帖最后由 kyonctw 于 2021-8-23 14:38 编辑
//初始化spread
spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {calcOnDemand: true})
var excelFile = target
var oReq = new XMLHttpRequest();
oReq.open('get', excelFile, true);
oReq.responseType = 'blob';
oReq.onload = function () {
var blob = oReq.response;
excelIo.open(blob, LoadSpread, function (message) {
});
};
//初始化designer,config是我在defaultconfig基础上加的按钮
designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById("designerHost"), config, spread);
我调用接口返回新的excel,刷新excel
spread.destroy()
target=res.data//重新初始化
initSpread()
然后就出现两个自定义按钮了
|