Check data binding

Hi Syncfusion Team,

I'm using TreeGrid and I need to bind a large amount of data to the TreeGrid. I've noticed that binding data takes a bit of time, and during this data-binding process, I want to display some messages to let the users know. Therefore, I need to check when the data binding starts and when it completes.

Is the any way to reach my requirement?

Thanks.


1 Reply

SM Shek Mohammed Asiq Abdul Jabbar Syncfusion Team August 28, 2023 03:56 PM UTC

Hi Ton That Hung,


Greetings from Syncfusion support.


You can start showing the message before the data bind in the treegrid by using beforeDataBound event and hide the message after the data have bound in dataBound event. Please refer to the following code snippet.


<div *ngIf="!dataLoaded" style="color: Blue; background-color: Orange; text-align: center">

  <p>Data binding is in progress...</p>

</div>

 


export class AppComponent {

  . . . .

  public dataLoadedboolean = false;

 

  public ngOnInit(): void {

  . . .

  beforeDataBound(args)any {

    this.dataLoaded = false

  }

 

  dataBound(args)any {

    this.dataLoaded = true;

  }

 


Sample : https://stackblitz.com/edit/angular-m57bip-gnygdk?file=src%2Fapp.component.ts


Kindly get back to us for further assistance.


Regards,

Shek Mohammed Asiq


Loader.
Up arrow icon