I want to display a loading gif instead of the default text "Processing" for processing.
This is what I did to achieve the same :
"language": {
"processing": "<img src='~/Content/images/loadingNew.gif' />"
},
But it didn't work. is it because of the way I'm referring to the image source?
Here's my JS for Datatable :
$(document).ready(function () {
$('#searchResult').DataTable(
{
"dom": '<"top"lB>rt<"bottom"ip>', // DataTable element position
"buttons": [
{
text: '<span class="glyphicon glyphicon-refresh" data-toggle="tooltip" title="Refresh Search Table"/>',
action: function (e, dt, node, config) {
ReloadData();
}
},
{
text: '<span class="fa fa-file-excel-o" data-toggle="tooltip" title="Export To Excel"/>',
action: function (e, dt, node, config) {
ExportRequests();
}
},
'colvis'],
initComplete: function () {
$('.buttons-colvis').html('<span class="glyphicon glyphicon-cog" data-toggle="tooltip" title="Column Visibility"/>') // Adds icon to the Column Visibility Button
},
"lengthMenu": [[10, 25, 50, 100, 500], [10, 25, 50, 100, 500]], // page length options
"pageLength": 25, // default page length
"pagingType": "full_numbers", // pagination related buttons
"ordering": true,
"order": [[0, "desc"]],
"scrollX": true, // enables horizontal scrolling
"filter": true,
"responsive": true,
"serverSide": true,
"info": true, // control table information display field
"stateSave": true, //restore table state on page reload,
"language": {
"infoFiltered":"",
"processing": "<img src='~/Content/images/loadingNew.gif' />"
},
processing: true,
"fnPreDrawCallback": function () {
debugger;
},
"fnDrawCallback": function () {
debugger;
},
"ajax":
{
"url": Helper.baseUrl() + "Search/LoadData",
"type": "POST",
"datatype": "json",
"data": function (d) {
d.searchParams = searchFilters();
},
},
"columns":
[
{
"data": "RequestNo",
} //and so on
],
});
Am I missing anything?