fnDeleteRow not deleting correct row when using ScrollInfinite but working with pagination

fnDeleteRow not deleting correct row when using ScrollInfinite but working with pagination

vinaybvkvinaybvk Posts: 3Questions: 0Answers: 0
edited April 2014 in DataTables
Hi,

I am having issue with fnDeleteRow, it is not deleting the correct row when using infinite scroll but working fine when using pagination.

My table initialization:
[code]
$('#example').dataTable({
"sDom": '',
"bScrollInfinite": true,
"bScrollCollapse": true,
"sScrollY": "200px"
});
[/code]

I am performing delete operation on clicking on the row as below: (For providing the row as dom I am using get(0))
[code]
$(document).on('click','#example tbody tr', function () {
var dataTable = $('#example').dataTable();
dataTable.fnDeleteRow($(this).get(0));
});
[/code]

When I am initializing the table without scrollinfinite as below then delete row is happening fine
[code]
$('#example').dataTable({
"sDom": '',
"bScrollInfinite": false,
"bScrollCollapse": false,
"sScrollY": "200px"
});
[/code]

Is there any extra configuration do I need to do for delete while using scroll infinite.

JSFiddle link of the example: http://jsfiddle.net/vinaybvk/LBkuY/

Thanks,
Vinay.

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Infinite scrolling is deprecated in 1.9 and removed in 1.10. There are a lot of issues with it, such as the example you give, and it is no longer a supported part of DataTables.

    I would suggest removing the infinite scrolling option.

    Allan
  • vinaybvkvinaybvk Posts: 3Questions: 0Answers: 0
    Thanks for the reply Allan, will remove it and use the pagination.

    Thanks,
    Vinay.
This discussion has been closed.