How to determine when jQuery datatable is created and loaded with data

0
134

You can use the fnDrawCallback function. It gets called every time the table is drawn. This would include when the table is loaded with data, sorted or filtered.

You better use fnInitComplete:

$(document).ready(function () {
    $('#example').dataTable({
        "fnInitComplete": function (oSettings, json) {
            alert('DataTables has finished its initialisation.');
        }
    });
})

LEAVE A REPLY

Please enter your comment!
Please enter your name here