【发布时间】:2016-05-13 12:34:32
【问题描述】:
即使数据已加载,“未找到匹配记录”行仍保留在我的表中。
表定义如下:
<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);
关于它为什么保留的任何想法?
【问题讨论】:
-
尝试为
table设置datatable="ng"属性,参见angular way。 -
@Gyrocode.com 100% 正确,很容易复制案例。尝试在其中一列中排序,所有行都会消失,因为数据表不知道数据 - 它不知道角度已经呈现了表格。
-
Cheers @Gyrocode.com 这已经解决了这个问题。
-
你试过datatable.draw()方法吗?
标签: javascript datatables angular-datatables