Duplicate records appended to DataTables on redrawing while bScrollInfinite property is used

Duplicate records appended to DataTables on redrawing while bScrollInfinite property is used

ashis82ashis82 Posts: 6Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
Duplicate records (the last 10 visible records) appended to DataTables each time when I am redrawing the table using the below code

Redrawing Datatables
--------------------------
myExample .fnDraw(false);

If I remove the false parameter, duplication is not found but scrollbar is moving to top.

My Requirement
-------------------
I want to redraw the datatables with the scrollbar @ the existing location.

NOTE: "bScrollInfinite" and "bServerSide" is true.
If I removed the property "bScrollInfinite" then data duplication is not found.

Here is my configuration:
-------------------------------------------------
$(document).ready( function (){
var myExample = $('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"bScrollInfinite": true,
"bScrollCollapse": true,
"sScrollY": "300px",
"sAjaxSource": "scripts/server_processing.php"
});
});

Does anybody knows why is this problem occurs?
I would appreciate if anybody has the solution with working examples.

Thanks in advance

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > Does anybody knows why is this problem occurs?

    Yes, you are using fnDraw(false) with server-side processing enabled and infinite scrolling. To be honest I would suggest you don't use infinite scrolling in DataTables - it is a feature I am considering dropping as it is not a good solution and has too many holes in it. Indeed, I am not likely to fix any issues in it at the moment.

    I would suggest you use `fnDraw()` (no false with server-side processing) and Scroller.

    Allan
  • CipsickoCipsicko Posts: 1Questions: 0Answers: 0
    Hi, i think i'had the same problem, but i fix it whit a simple one line script :)
    when i use the "sScrollY" the header will duplicate whit one of this is able to order collums. the another is useless, in fact it scoll whit che main content of the table.

    i've solve it using this code putting it in the "fnDrawCallback" section

    $('.dataTables_scrollBody thead').remove();

    after this i found another problem.
    the header visible doesn't see the box in which it has been put

    now i'm using the "paginate" mode because i don't fine any alternative solution

    i hope i was clear, sorry for my english
    cheers
This discussion has been closed.