改善数据表的数据显示

时间:2019-07-12 13:09:28

标签: javascript ajax datatables

我想知道是否有解决方案来改善数据显示时间(1万行),目前需要7到8秒。我已经签出this post,但它并没有真正改变我当前的加载时间。

这是我的代码:

currentAuditTable = $('#auditTable').DataTable({
        responsive: false,
        ajax: {
            "url": restURI + 'orch/search/audit/'+encodeURI(auditFlowId)+'/'+encodeURI(auditEventId),
            "contentType": "application/json",
            "type": "GET",
            "data": null,
            "error": function(jqXHR, textStatus, errorThrown){
                if (globalVars.unloaded) {
                    return;
                }
                manageAjaxError(jqXHR, textStatus, errorThrown)
            }
        },
        order: [3, 'desc'],
        pageLength: 50,
        autoWidth: true,
        deferRender: true,
        columns: [
            {"data": "EVENT_ID", "defaultContent": "", "sClass": "text-center limitedWidth", "width": "5%"},
            {"data": "OPERATION_NAME", "defaultContent": "", "sClass": "text-center limitedWidth", "width": "10%"},
            {"data": "OPERATION_STATUS", "defaultContent": "", "sClass": "text-center limitedWidth", "width": "10%"},
            {"data": "CREATE_DATE", "defaultContent": "", "sClass": "text-center limitedWidth", "width": "10%"},
            {"data": "OPERATION_MESSAGE", "defaultContent": "", "sClass": "text-center limitedWidth", "width": "25%"},
            {"data": "OPERATION_DATA", "defaultContent": "", "sClass": "text-center limitedWidth", "width": "25%"}
        ]
    });

我将不胜感激,因为我现在被卡住了。谢谢!

0 个答案:

没有答案