Jquery datatables 過載資料方法

weixin_34262482發表於2014-05-09

參考這裡

  RefreshTable('#table-example', '/BlogManage/GetLabelData');

}

function RefreshTable(tableId, url) {

    $.getJSON(url, null, function (json) {
        var table = $(tableId).dataTable();
        var oSettings = table.fnSettings();
        table.fnClearTable(this);
        for (var i = 0; i < json.aaData.length; i++) {
            table.oApi._fnAddData(oSettings, json.aaData[i]);
        }
        oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
        table.fnDraw();
    });
}

相關文章