Triggered when the active sheet changes. The binding method can be referenced as follows:
// Event binding
let wsheet = new websheet('yourID', yourElement);
wsheet.$on("SheetChange", function (activeName) { // Name of the activated sheet
console.log(activeName)
});
Triggered when the active cell changes. The binding method can be referenced as follows:
// Event binding
let wsheet = new websheet('yourID', yourElement);
wsheet.$on("ActiveCellChange", function (sheetname, activeRange, oldactiveRange) {
console.log(sheetname+' '+activeRange+' '+oldactiveRange);
});
Triggered when the cell value changes. The binding method can be referenced as follows:
wsheet.$on("CellValueChange", function (activesheet, cell) {
console.log("CellValueChange: " + activesheet.name + ' ' + cell.r + ' ' + cell.value);
});
Triggered when rows are added or deleted. The binding method can be referenced as follows:
wsheet.$on("RowChange", function (activesheet, type, sheetname, start, num) {
// type I for insert, D for delete
console.log("RowChange: " + type + ' ' + sheetname + ' ' + start + ' ' + num)
});
Triggered when columns are added or deleted. The binding method can be referenced as follows:
wsheet.$on("ColChange", function (activesheet, type, sheetname, start, num) {
// type I for insert, D for delete
console.log("ColChange: " + type + ' ' + sheetname + ' ' + start + ' ' + num)
});
Triggered when the file loading is complete. The binding method can be referenced as follows:
wsheet.$on("DocumentChange", function () {
activeSheet = wsheet.ActiveSheet();
activeSheet.SetCellValue(2, 1, '3435354.34');
console.log("DocumentChange:")
});
It is necessary to re-acquire the activeSheet here, as the originally initialized activeSheet becomes invalid.