ajax powered datatable hanging on 'processing'
ajax powered datatable hanging on 'processing'
Matt_mek
Posts: 3Questions: 0Answers: 0
Hi All,
I've made a table populated by server side script, initialised in the following way;
[code]
dTable = $('#ra_dates').dataTable({
"bFilter": false,
"bPaginate": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": $gdata+'&t='+ut(),
"fnServerParams": function(aoData) {
aoData.push({'name': 'm', 'value': $(this).attr('id')}, {'name': 'ra_id', 'value': '{ra_id}'});
},
"fnInfoCallback": function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
if (iEnd > 0) {
$('.tbl_dp').datepicker({dateFormat: "dd-mm-yy"});
$('.tbl_currency').inputmask('99999.99', {numericInput: true,placeholder:' '});
}
}
});
[/code]
It initialises with no problem upon first load of the page.
When calling fnDraw(); and there is new data to load (im adding things to the table via ajax and then calling fnDraw to see the results) there are no problems, it redraws with the new data.
The problem arises when there is no new data, and fnDraw is triggered; it just shows the 'processing...' text.
Not only this, but when i try and add new data after this and call fnDraw again, it continues to show 'processing..' text and doesn't redraw the table with the new data.
Any ideas?
I've made a table populated by server side script, initialised in the following way;
[code]
dTable = $('#ra_dates').dataTable({
"bFilter": false,
"bPaginate": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": $gdata+'&t='+ut(),
"fnServerParams": function(aoData) {
aoData.push({'name': 'm', 'value': $(this).attr('id')}, {'name': 'ra_id', 'value': '{ra_id}'});
},
"fnInfoCallback": function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
if (iEnd > 0) {
$('.tbl_dp').datepicker({dateFormat: "dd-mm-yy"});
$('.tbl_currency').inputmask('99999.99', {numericInput: true,placeholder:' '});
}
}
});
[/code]
It initialises with no problem upon first load of the page.
When calling fnDraw(); and there is new data to load (im adding things to the table via ajax and then calling fnDraw to see the results) there are no problems, it redraws with the new data.
The problem arises when there is no new data, and fnDraw is triggered; it just shows the 'processing...' text.
Not only this, but when i try and add new data after this and call fnDraw again, it continues to show 'processing..' text and doesn't redraw the table with the new data.
Any ideas?
This discussion has been closed.
Replies
jquery 1.8.2 && jquery ui 1.10.3
datatables 1.9.4