Open elkon028 opened 1 year ago
https://api.onlyoffice.com/plugin/executemethod/text/getalloleobjects
config.json
{ "name": "report", "guid": "asc.{4B8FEA54-6EDA-1B1B-EF2F-EF9F12248E44}", "version": "1.0.0", "baseUrl": "", "variations": [ { "description": "test report", "url": "index.html", "icons": ["resources/light/icon.png", "resources/light/icon@2x.png"], "icons2": [ { "style": "light", "100%": { "normal": "resources/light/icon.png" }, "125%": { "normal": "resources/light/icon@1.25x.png" }, "150%": { "normal": "resources/light/icon@1.5x.png" }, "175%": { "normal": "resources/light/icon@1.75x.png" }, "200%": { "normal": "resources/light/icon@2x.png" } }, { "style": "dark", "100%": { "normal": "resources/dark/icon.png" }, "125%": { "normal": "resources/dark/icon@1.25x.png" }, "150%": { "normal": "resources/dark/icon@1.5x.png" }, "175%": { "normal": "resources/dark/icon@1.75x.png" }, "200%": { "normal": "resources/dark/icon@2x.png" } } ], "EditorsSupport": ["word"], "isSystem": false, "isViewer": false, "isVisual": true, "isModal": true, "isInsideMode": false, "initDataType": "none", "initData": "", "size": [700, 10000] } ] }
// .... plugin.init = function () { var plugin = window.Asc.plugin plugin.init = function () { plugin.executeMethod ("GetAllOleObjects", [plugin.guid], function (data) { console.info('GetAllOleObjects', data) // data is undefined }); } }
// OR
plugin.init = function () { var plugin = window.Asc.plugin var image = { data: '', imgSrc: 'https://fanyi-cdn.cdn.bcebos.com/static/translation/img/header/logo_e835568.png', guid: plugin.guid, "width": 70, "height": 70, "widthPix": 60 36000, "heightPix": 60 36000 }
plugin.executeMethod('AddOleObject', [image], function () { plugin.executeMethod('GetAllOleObjects', [plugin.guid], function (data) { console.info('GetAllOleObjects', data) // data is undefined }) }) }
**data is undefined, why?**
https://api.onlyoffice.com/plugin/executemethod/text/getalloleobjects
config.json
// OR
plugin.init = function () { var plugin = window.Asc.plugin var image = { data: '', imgSrc: 'https://fanyi-cdn.cdn.bcebos.com/static/translation/img/header/logo_e835568.png', guid: plugin.guid, "width": 70, "height": 70, "widthPix": 60 36000, "heightPix": 60 36000 }
plugin.executeMethod('AddOleObject', [image], function () { plugin.executeMethod('GetAllOleObjects', [plugin.guid], function (data) { console.info('GetAllOleObjects', data) // data is undefined }) }) }