I'm using datatables. My code is working fine. Now I want to add a loader image(gif). I don't know how to add this. Here is my datatable script .
$(document).ready(function() {
var ref = $('#example').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "mails",
"columns": [
{ "data": "from" },
{ "data": "object" },
{ "data": "created" }
]
} );
} );
You can simply put an image tag within the language option:
language: {
processing: "<img src='img/loading.gif'>"
}
You can use language.sLoadingRecords to show an ajaxload-gif, example :
...
language : {
sLoadingRecords : '<span style="width:100%;"><img src="http://www.snacklocal.com/images/ajaxload.gif"></span>'
},
...
demo -> http://jsfiddle.net/acjngj30/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With