Posted 21 August 2019, 2:44 pm EST - Updated 3 October 2022, 7:35 pm EST
Hi,
I follow your instruction from https://www.grapecity.com/forums/wijmo/flexsheet-selectionchanged.
My sheet was shaking, when I select one cell to another cell, and also it occured [Violation] ‘setTimeout’ handler took ms. Could you please help ?
This is my code
onSelectionChanged() {
console.log("Changed !!");
if (this.formatSheet.selection.col == 0) {
console.log("Open Modal !");
this.rowId = this.formatSheet.selection.row;
this.apiService.showUploadedFileByRow(this.idGrid, this.rowId).subscribe(
res => {
this.attached = res;
if (this.attached.success) {
this.attached = this.attached.data;
document.getElementById('openUploadModal').click();
} else {
// this.attached = "";
}
console.log(this.attached);
},
err => {
// alert(err.message);
console.log(err);
}
);
}
if (this.formatSheet.selection.col == 1) {
console.log("Open Comment Modal !");
this.rowId = this.formatSheet.selection.row;
this.apiService.showSheetCommentsByRow(this.idGrid, this.rowId).subscribe(
res => {
this.comments = res;
if (this.comments.success) {
this.comments = this.comments.data;
document.getElementById('openCommentModal').click();
} else {
this.comments = "";
}
console.log(this.comments);
},
err => {
console.log("Error " + err);
}
);
}
}
<wj-flex-sheet #formatSheet (selectionChanged)="onSelectionChanged()">
<wj-sheet [itemsSource]="source" name="{{sheetTitle}}"></wj-sheet>
</wj-flex-sheet><br>
Thanks.
Oskar Putra