Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35281

Scroller and fixed columns together

$
0
0

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
});
});


Viewing all articles
Browse latest Browse all 35281

Trending Articles