I'm trying to show overlay template when the service URL fails in ag-grid.
But the overlay message is not displaying as expected.
I wanted to show Service URL failed
message when the http request fails. And another overlay message Please wait data is loading
when data is actually loading in the grid.
I'm unable to display the overlay message when the url gets failed. it always show's the first message
How do i fix this ?
This my link to the plunker project : https://plnkr.co/edit/MzpwnE0enLx2PVJOFUyn?p=preview
Note: to replicate the issue, give some invalid http url
this._Service.httpPost(b, a)
.retryWhen((err) => {
return err.scan((retryCount) => {
retryCount += 1;
if (retryCount < 3) {
return;
} else {
this.gridOptions.overlayNoRowsTemplate = '<span class="messageStyles">Problem with service link. Please try again later</span>';
this.gridOptions.api.showNoRowsOverlay();
throw (err);
}
}, 0).delay(1000);
})
.catch(err => {
console.log(err);
return Observable.of(err);
});