我正在使用 ag-grid
rowModelType=serverSide
,当前加载数据时我的叠加层有一个微调器,如下图所示。我想删除那个旋转器。我尝试过 hideOverlay()
但显然旋转器不是叠加层。不知道如何删除它?
如文档中所述,当使用除客户端行模型之外的行模型时,不使用叠加。
要自定义
rowModelType=serverSide
时的加载,需要自定义Loading Cell Renderer。
class CustomLoadingCellRenderer {
init(params) {
this.eGui = document.createElement('div');
this.eGui.innerHTML = `
<div class="ag-custom-loading-cell" style="padding-left: 10px; line-height: 25px;">
<span>${params.loadingMessage} </span>
</div>
`;
}
getGui() {
return this.eGui;
}
}
const gridOptions = {
loadingCellRenderer: CustomLoadingCellRenderer,
loadingCellRendererParams: {
loadingMessage: 'Loading',
},
rowModelType: "serverSide",
onGridReady: (param) => {
param.api.setServerSideDatasource(datasource)
}
}
const App = () => {
const [rowData] = useState([]);
const [columnDefs] = useState(columns);
return (
<div className="ag-theme-alpine" style={{ height: 400, width: 600 }}>
<AgGridReact gridOptions={gridOptions} rowData={rowData} columnDefs={columnDefs}
modules={[ServerSideRowModelModule]}
></AgGridReact>
</div>
);
};