我试图在我的表格中应用dataTabe,但我没有得到正确的数据表。
我首先在角度表中填充我应用dataTable的数据,而没有dataTable我得到了正确的结果;
我的控制器:
MyService.getData(function (response) {
if (response.data.success) {
$scope.items = angular.copy(response.data);
$timeout(function () {
var table = $("#test").dataTable();
}, 200)
} else {
$scope.items = [];
}
});
HTML:
<table id="test">
<thead>
<tr>
<th style="width: 10%">Id</th>
<th style="width: 20%">Group Name</th>
<th style="width: 20%">Created Date</th>
<th style="width: 20%">Updated Date</th>
</tr>
</thead>
<tbody ng-repeat="item in items">
<tr>
<td>{{item.userGroupId}}</td>
<td>{{item.groupName}}</td>
<td>{{item.createdDate}}</td>
<td>{{item.updatedDate}}</td>
</tr>
</tbody>
</table>
screenShots:
在应用DataTable之前:
应用dataTable之后:
我在dataTable doc和google中搜索了但是我没有发现任何线索。请帮助我。