Callback afer datatable is ready?

Callback afer datatable is ready?

orange_roughyorange_roughy Posts: 19Questions: 0Answers: 0
edited January 2011 in General
Hi,

I'm loading 4000-5000 rows into datatable. It takes a long time (5 seconds or so). I'd like to make that faster, of course, but in the meantime I'd like to display a "Please wait..." modal dialog on the screen. I currently have a "Please wait..." message in the table itself, before the rows are loaded, but this message disappears very quickly, long before the datatables's 5 seconds are completed.

Is there a callback I can use to find out when datatable is ready to be be manipulated? fnInitComplete() doesn't get called. Here's what i'm doing:

[code]
entityGroupTable = $("#entityGroupTable").dataTable({
"aoColumnDefs": [{aTargets:[1], "sSortDataType": "dom-checkbox"}],
"bScrollCollapse": true,
"sScrollY": "200px",
"oLanguage": {
"sSearch": "Global Search:" // TODO: i18n
},
"bSortClasses": false,
"iDisplayLength": 20,
"bScrollInfinite": true,
"fnInitComplete": function() { alert("ready"); },
"aaSorting": [] // disable initial sorting for performance reasons
});
[/code]

thank you,
orange roughy

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Odd - fnInitComplete should be called. I've just tried it and it seems to work okay. What version of DataTables are you using? Also where is the data coming from - the DOM I presume given the initialisation?

    Allan
This discussion has been closed.