Scroller ignores scroll when using ColReorder and state saving
Scroller ignores scroll when using ColReorder and state saving
I want to use the Scroller extension but I doesn't work if I also use the ColReorder extension and the state saving option. The first time the page loads, everything works, but on the second time I can only see the rows around my last position. I can't scroll up or down. I noticed that the following variable in the Scroller extension never gets set to false but I don't understand why:
this.s.ingnoreScroll = true;
If I disable state saving and keep ColReorder it works.
If I disable ColReorder and keep state saving it works.
But the combination of both doesn't.
Here is my DataTable setup:
datatable = $table.DataTable({
scrollX: true,
scrollY: "600px",
scrollCollapse: true,
scroller: {
loadingIndicator: true,
displayBuffer: 4
},
serverSide: true,
ajax: {
url: settings.readUrl,
type: "POST"
},
stateSave: true,
columns: datatableFields,
order: [[1, 'asc']],
dom:
"T" + // tableTools
"<'row'<'col-sm-6'f><'col-sm-6'C>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-6'i><'col-sm-6'>>" +
"S", // Scroller
tableTools: {
sRowSelect: "multi",
sRowSelector: 'td:first-child input[type="checkbox"]',
aButtons: [],
fnRowSelected: onRowSelected,
fnRowDeselected: onRowDeselected
},
colVis: {
buttonText: "Colonnes",
exclude: [ 0 ],
overlayFade: 0
}
});
tableTools = TableTools.fnGetInstance(settings.tableSelector.replace('#', ''));
colReorder = new $.fn.dataTable.ColReorder(datatable);