I'm on Angular 13, using @syncfusion/ej2-angular-spreadsheet v 20.2.43. I'm trying to insert icons on my spreadsheet using insertImage(images: ImageModel, range?: string): void; SpreadsheetComponent method;
ImageModel; specifies the options to insert image in spreadsheet (src path,height,width,id.....)
range; specifies the range in spreadsheet (address)
My insertImage method is called inside an async method m1. The first time I called m1, insertImage works as expected, I can see the icon on my spreadsheet cell address (example: this.spreadsheetObj.insertImage([imageModel],address);), but, when I recall my async method m1 again, no cell being updated.
PS: weirdo case is : when I call insertImage twice, next to each other, one after the other , I can see a diffrence , the icon is on the cell, but being focused (red tag on it for each movement in the spreadsheet table), that's why I did suggest to exit the async method and call it again to have the same case as my first cell (the first icon is not being focused by the red tag)
Does the async method break something on spreadsheet insertImage method ?
Any thoughts !
We have checked your issue by creating a sample in both the mentioned and latest versions with a button click event for inserting an image into the sheet. It works as expected. Hereby, attaching the sample for your reference.
We also recommend that you update to the latest Syncfusion packages to avail of the latest fixes and updates.
If still the issue persists, kindly replicate the issue in the above attached sample and also share the replicable video demonstration to proceed further.
Hello @Vasanth Ravi,
Thank you for your quick response. Inserting images working as expected on your attached example, but regarding my issue I did found that refreshing the spreadsheet using "spreadsheetObj.refresh(false);" which did broke my inserts for the second try. I did remove this "suggested broken instruction" and update the necessary changes to successed the insert for any case, actually, we did get the expected results, but sometimes we need spreadsheet refresh to update data and cells styling after image inserts.
Kindly suggest if any changes are required for refreshing the spreadsheet.
PS: Find attached my stackblitz example (this example : is working on inserting Image while popover (clicking) the corresponding cell)