Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cabf642

Browse files
committed
Update app.component.ts
1 parent 8363cb9 commit cabf642

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

‎demos/grid/sparklines-featured/src/app/app.component.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,8 +1392,13 @@ export class AppComponent implements AfterViewInit {
13921392
}
13931393
]
13941394

1395+
13951396
ngAfterViewInit(): void {
13961397
const updatePortfolio = (portfolio: any[], intervalDays = 1) => {
1398+
if (!portfolio) {
1399+
return;
1400+
}
1401+
13971402
portfolio.forEach(asset => {
13981403
// --- Update purchaseDate ---
13991404
let date = new Date(asset.purchaseDate);
@@ -1418,11 +1423,13 @@ export class AppComponent implements AfterViewInit {
14181423
return portfolio;
14191424
};
14201425

1421-
setInterval(() => {
1422-
this.grid.beginUpdate();
1423-
updatePortfolio(this.grid.dataSource);
1424-
// only refresh the cell values.
1425-
this.grid.endUpdate(false);
1426-
}, 1000);
1426+
setInterval(() => {
1427+
this.grid.nativeElement.beginUpdate();
1428+
updatePortfolio(this.grid.nativeElement.dataSource);
1429+
// only refresh the cell values.
1430+
(this.grid.nativeElement as any).endUpdate(false, true, false);
1431+
}, 1000);
1432+
14271433
}
1434+
}
14281435
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /