Don*_*l M 2 javascript datatables angular-datatables
即使数据已加载,“未找到匹配的记录”行仍保留在我的表中。
该表定义如下:
<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>
Run Code Online (Sandbox Code Playgroud)
控制器中的dtOptions如下:
self.dtOptions = DTOptionsBuilder.newOptions()
.withDOM('t')
.withOption('scrollY', '200px')
.withOption('scrollCollapse', true)
.withOption('paging', false)
.withOption('bSort', false)
.withOption('responsive', true);
Run Code Online (Sandbox Code Playgroud)
关于它为何保留的任何想法?
如果您使用 Angular2 或更高版本、组件级别的 SCSS 或 CSS(不是全局级别),
::ng-deep table.dataTable td.dataTables_empty {
display: none;
}
Run Code Online (Sandbox Code Playgroud)