我的数据表包含非常庞大的数据,因此排序需要相当长的时间。是否有任何规定我可以在给定列上进行排序过程时显示一些加载图像/消息?
答案 0 :(得分:1)
请尝试this
您可以根据列设置位置,并将其与click事件绑定。
答案 1 :(得分:0)
$('#TABLE').DataTable({
"processing": true,
"ajax": {
type: "POST",
url: '@Url.Action("ACTION", "CONTROLLER")',
contentType: "application/json",
data: function (d) {
//DATA YOU PASS
}
},
"columnDefs": [{ "className": "dt-center", "targets": "_all" }],
"columns": [
{
"className": 'details-control',
"orderable": false,
"data": null,
"defaultContent": '',
width: '5px'
},
{ "data": "status", "orderable": true, title: "Status" },
{ "data": "count", "orderable": true, title: "Project Count" }
],
"order": [[1, 'asc']],
"scrollCollapse": true,
"paging": true,
"bDestroy": true,
"dom": "lftipr",
"language": {
"processing": ' <i class="fa fa-spinner fa-pulse fa-3x fa-fw" style="color: #1E407C; font-size: 50px;"></i>',
}
});