Showing processing icon/msg while loading
Showing processing icon/msg while loading
Hey Allan ![]()
i'm trying to show loading indicator while loading.
I tried everything that is commented.
the only thing that half worked was the fnInitComplete but i didnt find an event that indicate on the start of the loading.
but didnt worked.
$('#table').DataTable({
dom: 'Bfrtip',
// fnInitComplete : function() {
// alert("loading start");
// },
// language: {
// "processing": "Loading. Please wait..."
// },
// "processing": true,
buttons: ['csv', 'excel', 'pdf'],
"footerCallback": function(row, data, start, end, display) {
var api = this.api();
api.columns('.sum', {
page: 'current'
}).every(function(s) {
if (s != 2) {
var sum = this
.data()
.reduce(function(a, b) {
var x = parseFloat(a) || 0;
var y = parseFloat(b) || 0;
return Number(x + y).toFixed(2);
}, 0);
}
$(this.footer()).html(sum);
});
}
});
how can i fix this ?
Thanks ![]()
This discussion has been closed.
Answers
The loading happens synchronously with the DataTable initialisation. So it is safe to simply display the loading indicator before you initialise the DataTable.
Allan