Scroller and fixed columns together
Scroller and fixed columns together
Hello! Did anybody use scroller extension together with fixed columns one?
When trying to apply both extensions, only the header has fixed columns, while the body doesn't.
What am I doing wrong?
I want a simple table with 40 columns (10 fixed) and 20000 rows.
Here is my code:
$(document).ready(function () {
var data = [];
for (var i = 0 ; i < 20000 ; i++) {
data.push([i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i]);
}
var oTable = $('#example').dataTable({
data: data,
deferRender: true,
dom: "frtiS",
scrollY: 1000,
scrollX: true,
scrollCollapse: true
});
new $.fn.dataTable.FixedColumns(oTable, {
leftColumns: 10
});
});
Answers
Hello! Have same problem.
When removing: dom: "frtiS", Fixed columns works correctly, but Scroller turns off.
Can someone give any advice? Will be really appreciate for any help. I learn coding for about 2 weeks, and sometimes it blows my brain!!!
Datatables initialisation code. Probably, problem somewhere here.