I have a table in which I am using datatables jQuery plugin with fixed columns add on for fixed column and fixed row.
Plugin is working fine for me. Now I want to scroll to a specific cell on table load. I have an id of the cell.
I tried following:
$(document).ready(function () {
var oTable = $('#masterGridTable').dataTable({
"sScrollY": "255px",
"sScrollX": "100%",
"sScrollXInner": "150%",
"bScrollCollapse": false,
"bPaginate": false,
"bFilter": false,
"bInfo": false,
"fnInitComplete": function (oSettings, json) {
}
});
new FixedColumns(oTable);
var scrollToView = document.getElementById('selectedElementId');
if (scrollToView)
scrollToView.scrollIntoView(true);
});
It works but the problem it that scrollIntoView method doesn't scroll the cell in middle of the screen.
I also tried using a jQuery scroll plugin.
This works fine if i use it without datatables, but both doesn't work at the same time.
Any ideas?