我有一个datatable,它花费了很多时间来显示数据
我在组件中这样调用脚本:
ngAfterViewInit() {
$.getScript('./assets/js/datatables/datatable-basic.js');
}
以html格式呈现数据,如下所示
<table class="table zero-configuration">
<thead>
<tr>
<th>Name</th>
<th>ID</th>
<th></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let companyData of company?.companies; trackBy: userThumb">
<td class="text-truncate">{{ companyData?.name }}</td>
<td class="text-truncate">{{companyData?.id}}</td>
<td class="text-truncate"></td>
</tr>
</tbody>
</table>
这是我的datatable basic。js公司
setTimeout(function () {
$('.zero-configuration').DataTable({
"iDisplayLength": 50,
"paging": true
});
}, 3000);
这些公司将拥有近5000个阵列。