FlexSheet selectionchanged

Posted by: oskarputraa on 21 August 2019, 2:44 pm EST

    • Post Options:
    • Link

    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

  • Posted 22 August 2019, 4:55 am EST

    Hi Oskar,

    We are sorry but we were not able to replicate the issue at our end. But the issue may be due to the API Service. The setTimeout violation warning is shown because your script is taking a long time to complete its execution and it can be improved.

    Could you please tell me about your requirement or provide a small sample so that we can investigate further or provide a different approach?

    Regards,

    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels