First, the overlay code should not have className
in it, as it is a plain HTML <span>
tag. so that might not be setting the classes right thus, not showing the overlay.
But, I had the same issue with the loader being quite bad and not informative. Luckily I can change it using the following CSS class (that i stole form semanticUI):
.loadingx:before {
position: absolute;
content: '';
top: 0%;
left: 0%;
background: rgba(255, 255, 255, 0.8);
width: 100%;
height: 100%;
border-radius: 0.28571429rem;
z-index: 100;
}
.loadingx:after {
position: absolute;
content: '';
top: 50%;
left: 50%;
margin: -1.5em 0em 0em -1.5em;
width: 3em;
height: 3em;
-webkit-animation: segment-spin 0.6s linear;
animation: segment-spin 0.6s linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
border-radius: 500rem;
border-color: #223088 rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1);
border-style: solid;
border-width: 0.2em;
box-shadow: 0px 0px 0px 1px transparent;
visibility: visible;
z-index: 101;
}
@-webkit-keyframes segment-spin {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes segment-spin {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
EDIT: here is literally how I am using it :
overlayLoadingTemplate:
'<div class="loadingx" style="margin: 7em"></div> <span class="ag-overlay-loading-center " style="font-size: 18px; z-index: 100000"> Loading Rows ...</span>',
the "Loading Rows ..." text doesn't actually show at all, you can remove it.
for showing the overLay using the API : gridApi.showLoadingOverlay()
for hiding it : gridApi.hideOverlay()
adding this class to the loader span (with class="loadingx"
) would instantly show a grey overlay and a circular loader in the middle.
hope this works.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…