If you're utilizing server-side rendering with the rowModelType: "serverSide"
option, you have the ability to customize the loadingCellRenderer. By leveraging the
gridOptions.columnApi.getColumnState()
method provided in the parameters, you can ensure that the width of each grey oval corresponds to the width of each column.
class EnhancedLoadingCellRenderer {
init(params) {
let container = document.createElement('div');
container.style.height = "100%";
container.style.width = "100%";
/* Adjust padding or border-radius according to your requirements */
for(let column of params.columnApi.getColumnState()){
if(column.hide){
continue;
}
let cell = document.createElement('div');
cell.style.display = "inline-block";
cell.style.width = column.width + 'px';
cell.style.height = "100%";
cell.style.padding = '15px';
let oval = document.createElement('div');
oval.style.backgroundColor = 'lightgray'
oval.style.borderStyle = 'none'
oval.style.height = "100%";
oval.style.width = "100%";
oval.style.borderRadius = '10px'
cell.appendChild(oval);
container.appendChild(cell);
}
this.container = container;
}
getGui() {
// Return the same container for each row
return this.container;
}
}
const advancedGridOptions = {
loadingCellRenderer: EnhancedLoadingCellRenderer,
loadingCellRendererParams: {},
rowModelType: "serverSide",
serverSideDatasource: datasource,
}
https://example.com/image.png
For client-side rendering, it may not be practical to implement an overlay Loading Template in the same manner because rows are not generated individually. However, you could still utilize a custom renderer for overlayLoadingTemplate
, where the loadingCells fill the entire grid.