0
SelfSwapAdmin created
Product Version: 10.2.0 Product Type: Angular 10.NET Core 5
We need to have the GetAll() method in one of our custom components initialized from the "Load Entity from Database" code-gen automatically refresh using a configurable interval. What is the best way to go about this? Is there an example somewhere we can look at? Thank you!
5 Answer(s)
-
0
Hi @SelfSwapAdmin Does using setInterval meet your project's needs?
ngOnInit(): void { this.setAutoRefreshTimer(); } private setAutoRefreshTimer(): void { let getAllInterval = abp.setting.getInt("XXXComponent.GetAllInterval"); setInterval(this.getAll, getAllInterval); }
-
0
I oversimplified a bit. Actually what is getting called is:
getComponentName(event?: LazyLoadEvent) { if (this.primengTableHelper.shouldResetPaging(event)) { this.paginator.changePage(0); return; } this.primengTableHelper.showLoadingIndicator(); this._ssFolioServiceProxy .getAll( this.filterText, .............. ..............
So GetAll is not being called directly is unresolved in setInterval(this.getAll, getAllInterval).
So in this case how SetInterval be used?
-
0
Hi,
Could you try using setInterval as below;
setInterval(() => { this.getAll(); }, getAllInterval);
-
0
-
0
Hi @SelfSwapAdmin Check: https://www.w3schools.com/jsref/met_win_setinterval.asp
setInterval(() => { //do whatever you want }, getAllInterval);