Fexgrid table is taking time on change itemsource values

Posted by: vinaybietpratap on 18 September 2024, 5:00 am EST

  • Posted 18 September 2024, 5:00 am EST

    Hi,

    Whenever I am changing the itemsource data in flexgrid table. Table taking time to render and it gets unresponsive upto 10 seconds. After debugging my code I have figured it below code is creating problem.

    onGridLoaded() {

    if ( this.flexGrid.itemsSource ) {

    this.addAlertIconColumn();

    setTimeout( () => {

    this.flexGrid.autoSizeColumns();

    this.flexGrid.autoSizeRows();

    if ( this.flexGrid && this.flexGrid[ ‘collectionView’ ] && this.flexGrid[ ‘collectionView’ ][ ‘currentItem’ ] ) {

    this.flexGrid[ ‘collectionView’ ][ ‘currentItem’ ] = null;

    this.flexGrid[ ‘collectionView’ ].collectionChanged.addHandler(() => this.assignColumns(false));

    }

    } );

    }

    }

    calling above function on after grid loads. and other one is [autoRowHeights]=“true” also causing slowness.

    Please suggest me any alternate way to auto size column and row.

    Using “@grapecity/wijmo.angular2.all”: “5.20203.766” version.

    Let me know if further details are required.

  • Posted 19 September 2024, 6:03 am EST

    Hi Vinay,

    I’d suggest you to use autoSizeRows on the rows available on screen and then resize the new rows on scroll.

    For this, please refer to the attached sample application: https://stackblitz.com/edit/angular-a1xogm

Need extra support?

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

Learn More

Forum Channels