即使已加载数据,“找不到匹配的记录”行仍保留在我的表上。
该表定义如下:
<table datatable dt-options="gvc.dtOptions" class="table table-striped">
<thead>
<tr>
<th data-priority="1">Alert Time</th>
<th data-priority="2">Description</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="alert in gvc.recentAlerts">
<td>{{alert.alert_time}}</td>
<td>{{alert.sent_text}}</td>
</tr>
</tbody>
以及控制器中的dtOptions如下:
self.dtOptions = DTOptionsBuilder.newOptions()
.withDOM('t')
.withOption('scrollY', '200px')
.withOption('scrollCollapse', true)
.withOption('paging', false)
.withOption('bSort', false)
.withOption('responsive', true);
关于它为什么要保留的任何想法?
根据说明将以下代码放在src / styles.css(即您的全局样式)中]
.dataTables_empty {
display: none;
}
如果您使用的是Anguler2或更高版本,则组件级别为SCSS或CSS(不是全局级别),
::ng-deep table.dataTable td.dataTables_empty {
display: none;
}