Fixed columns - auto horiz scroll to right on load
Fixed columns - auto horiz scroll to right on load
I have a table with 30+ columns, with fixed cols left and right,
At the moment when you load the table you see left part of the inner table, is it possible to automatically move this to the right so the later cols are visable first ?
At the moment when you load the table you see left part of the inner table, is it possible to automatically move this to the right so the later cols are visable first ?
This discussion has been closed.
Replies
While there isn't a built in initialisation parameter to do this, what you can do is simply set the 'scrollLeft' property of the DataTables scrolling element when the table has completed its initialisation. For example on this demo page ( http://datatables.net/release-datatables/extras/FixedColumns/left_right_columns.html ) you can run this following on the Javascript control to jump the scrolling position:
[code]
$('div.dataTables_scrollBody').scrollLeft(100);
[/code]
So in your DataTables initialisation code you could use fnInitComplete ( http://datatables.net/ref#fnInitComplete ) to run that code when the initialisation is done.
Regards,
Allan