Disable "Loading..." box which blocks all the table
Disable "Loading..." box which blocks all the table
Vasilii
Posts: 9Questions: 1Answers: 0
I am testing dataTable with simple JSON. The POST is executed successfully and data is inserted in the table body, but the "Loading..." block is still showing for forever. Also it block all the table, so I can not even test some sorting o searching features. Is there any ideas why data is populated but onDataLoad is called instead of onSuccess?
This discussion has been closed.
Replies
Sounds like a Javascript error is occurring. If you can give me a link to the page I can check it out.
Allan
I'm using Metronic theme for bootstrap. This is how the main code looks like:
var handleDemo1 = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_ajax"),
onSuccess: function (grid, response) {
console.log("response "+response);
},
onError: function (grid) {
console.log("error "+grid);
},
onDataLoad: function(grid) {
console.log("load "+grid);
},
loadingMessage: 'Loading...',
dataTable: {
"bStateSave": true,
"fnStateSaveParams": function ( oSettings, sValue ) {
$("#datatable_ajax tr.filter .form-control").each(function() {
sValue[$(this).attr('name')] = $(this).val();
});
return sValue;
},
"fnStateLoadParams" : function ( oSettings, oData ) {
$("#datatable_ajax tr.filter .form-control").each(function() {
var element = $(this);
if (oData[element.attr('name')]) {
element.val( oData[element.attr('name')] );
}
});
return true;
},
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 50, // default record count per page
"ajax": {
"url": "https://www.mocky.io/v2/5ae3515a310000390d083e3e",
"dataSrc": 'data'
},
"ordering": false,
"order": [
[1, "asc"]
]
}
});
https://beta9.nevakar.ru/dev/journeys/journeys.html
The JSON is on www.mocky.io/v2
Now I get onDataLoaded log. When added some extra characters to url I got onError, but never onSuccess.
Thank you in advance!
The loading element there is not one which is controlled by DataTables. It appears to be coming from this file with its wrapper:
I don't know if that is your own, or you've got it from somewhere else, but this:
is what is displaying the loading spinner, which then appears not to be removed.
Allan
Thank you, I deleted this "blockUI" and it helped