Showing loading on using Ajax on data table
Showing loading on using Ajax on data table
utsavsohal
Posts: 2Questions: 1Answers: 0
Hello,
I have created a data table to show the data in list using thymleaf template engine of java and jquery.
It works fine but when I want to to refresh the table on a event it shows me "loading..." on the table while all the
data is fetched from server.
Please help to resolve this.
Thanks in Advance
var table = $('#data-table').DataTable( {
//reload part
"ajax":{
"url" : "/vedanta-web/scorecard/reloadScoreCardTableByMonthAndYear",
"dataType": "JSON",
"type" : "POST",
"data":'{}',
"dataSrc": "Data",
"success": function(data, textStatus) {
alert("success and data: "+JSON.stringify(data));
console.log(JSON.stringify(data));
}
},
"order": [],
"stateSave": true,
"columnDefs": [{
"targets" : [-1,-2],
"orderable": false,
},
{
"targets" : [0],
"orderable": false,
}],
"columns": [
{"data": "contractNumber"},
{ "data": "contractId"},
{ "data": "vendor.name"},
{ "data": "categoryName"},
{ "data": "subCategoryName"},
{ "data": "yearId"},
{ "data": "template.frequency"},
{ "data": "submitted_by"},
{ "data": "submitted_on"},
{"data": "status"},
{"data": "contractNumber"}
]
} );
This discussion has been closed.
Answers