paging does not redraw site

paging does not redraw site

robertredcorrobertredcor Posts: 4Questions: 1Answers: 0
edited February 2014 in DataTables 1.10
Hi there,
I just started to use DataTables and I am impressed. Congratulations!

Here is the linke to the debugger output:
http://debug.datatables.net/opuhec

Now my problem:
I have the following methods defined:

$(document).ready(function() {
getFilteredCompanies();
} );

function getFilteredCompanies() {
var oTableCompanylist = $('#addrlist').dataTable( {
"processing": true,
"serverSide": true,
"ajax": "/getFilteredObjects",
"dataType": "json",
"sPaginationType": "full_numbers",
"sAjaxSource": "/getFilteredObjects",
"fnServerData": function (sSource, aoData, fnCallback) {
$.getJSON(sSource, aoData, function (json) {
//var parsedJSON = $.parseJSON(json);
fnCallback(json)
});
}

} );
}

They work fine on loading the page the first time.
When I then change the numer of records to display, a new set of records are fetched from the server, however they are not displayed.
The old set of data remains on the screen.
I did try to debug trough the code, but failed to find the reason.
Two things I found out:
1. A new set of records is processed.
2. the test on line 2476 (marked with <<--- below)
fails on the redraw.

if ( draw )
{
// Protect against out of sequence returns
if ( draw*1 < settings.iDraw ) { <<---
return;
}
settings.iDraw = draw * 1;
}

I do not understand the code well enough to judge whether this is a problem or not.

Thanks for pointers on how to fix my code
Robert

Replies

  • dbadba Posts: 1Questions: 0Answers: 0

    Same issue for me. I just commented the two lines ...
    so far so good, but i hope there won't be any other problem related to my own fix.

    Anyone to say what "// Protect against out of sequence returns" means ?

This discussion has been closed.