ng2-smart-table icon indicating copy to clipboard operation
ng2-smart-table copied to clipboard

Prevent page jump when refreshing table data

Open christomorrow opened this issue 3 years ago • 1 comments

I'm automatically refreshing the data by subscribing to HttpClient and populating LocalDataSource. Upon refresh, the page jump to top and back to the bottom where the table lies. I believe this is due to the table removing the rows then adding back the rows.

Any ideas how to prevent the page jump and make it data refresh more seamless?

source: LocalDataSource = new LocalDataSource();

this.httpService.getTableData() .subscribe((data: Data[]) => { this.source.load(data); });

christomorrow avatar Jan 01 '22 17:01 christomorrow

Increasing the height helps, however, no way of updating graph data once loaded.

::ng-deep ng2-smart-table tr { height: 70px; }

christomorrow avatar Jan 07 '22 23:01 christomorrow