[英]ag-grid hiding everything below column headers if no data found
When I use ag-grid of given fixed height with Angular, before any data is shown the space where data will be shown (so grid in fact) is visible with text 'loading'.当我在 Angular 中使用给定固定高度的 ag-grid 时,在显示任何数据之前,将显示数据的空间(实际上是网格)在文本“加载”中可见。 It's not correct in my case, as I don't bind rowData to Observable or Promise so it's not async.
在我的情况下这是不正确的,因为我没有将 rowData 绑定到 Observable 或 Promise 所以它不是异步的。 The grid is populated after click on button.
单击按钮后将填充网格。 I'd like to see only column headers and nothing below that.
我只想看到列标题,而没有列标题。 My grid config looks like that:
我的网格配置如下所示:
<ag-grid-angular
style="width: 100%; height: 335px;"
class="ag-theme-balham"
[gridOptions]="gridOptions"
[columnDefs]="columnDefs"
[rowData]="rowData"
animateRows
rowSelection="multiple"
>
So I'd like to hide whole grid except of column headers until rowData is empty array.所以我想隐藏除列标题之外的整个网格,直到 rowData 为空数组。 Is there a way to do this?
有没有办法做到这一点?
Just to clarify, I use ag-grid with React but there are many similarities between the two.为了澄清起见,我将 ag-grid 与 React 一起使用,但两者之间有许多相似之处。 There are two things you can do here:
您可以在这里做两件事:
[overlayLoadingTemplate]="<span></span>"
[overlayNoRowsTemplate]="<span></span>"
[domLayout]="autoHeight"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.