no_freedom no_freedom - 1 month ago 30
Javascript Question

Want to show loader gif in datatables

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 so far.

$(document).ready(function() {
$("#dvloader").show();
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
} );


here is my loader

<div id="loader">
<img src="ajaxloader.gif">
</div>

anu anu
Answer

If you want to replace the 'Processing...' string with an image as you mentioned in the comment you need to take a look here

$('#example').dataTable( {
    oLanguage: {
        sProcessing: "<img src='loading.gif'>"
    },
    processing : true
});
Comments