Posted 3 February 2021, 1:31 pm EST
Hi, we’re developing a prototype with VueJS testing all the features we’ll need for our final product.
We want to show the worksheet list and update whenever we delete a sheet, but we still haven’t found a working solution.
This is a snippet of our component:
export default {
name: 'SpreadSheetPrototype',
data() {
return {
spread: null,
sheetItemList: [],
};
},
methods: {
initSpread: function(spread) {
this.spread = spread;
let GCSheets = GC.Spread.Sheets;
this.spread.bind(GCSheets.Events.SheetChanged, function(sender, args) {
if (args.propertyName === 'deleteSheet') {
console.log('Deleted ' + args.sheetName); // display 'Deleted Sheet 1'
const numberOfSheets = spread.getSheetCount();
let sheetList = [];
for (let sheetIndex = 0; sheetIndex < numberOfSheets; sheetIndex++) {
sheetList.push({ index: sheetIndex, sheetName: spread.getSheet(sheetIndex).name() });
}
this.sheetItemList = sheetList; // this.sheetItemList is undefined
}
});
Do you have any suggestion in order develop this feature?
Thanks in advance for any help,
Ciro