Fixed Header Scrolling problem
Fixed Header Scrolling problem
reda_sondos
Posts: 2Questions: 0Answers: 0
Dear,
I have create a table using datatable plugin, and use the Fixed Header Extra.
and put this table at div with [overflow : auto], when column exceeded the div width, it create a horizontal scroll,
when i uses this scroll to scroll table columns, columns does not move according to the scroll.
see this snapshot...
http://imageshack.us/photo/my-images/716/datatablescrollingprobl.jpg/
I need your help...
Thanks.
I have create a table using datatable plugin, and use the Fixed Header Extra.
and put this table at div with [overflow : auto], when column exceeded the div width, it create a horizontal scroll,
when i uses this scroll to scroll table columns, columns does not move according to the scroll.
see this snapshot...
http://imageshack.us/photo/my-images/716/datatablescrollingprobl.jpg/
I need your help...
Thanks.
This discussion has been closed.
Replies
Allan
When i use the sScrollX in my Data Table plugin as the following:
-------------------
"sScrollX": "100%",
"bScrollCollapse": true
-------------------
it alerts me the following message.
-------------------------------------------------------------
FixedHeader 2 is not supported with DataTables' scrolling mode at this time.
-------------------------------------------------------------
please, Advise me...
Thanks,
is there no solution for this problem?
i got the same problem here :(
"FixedHeader 2 is not supported with DataTables' scrolling mode at this time"
Is there any solution/workaround for this issue?
[code]
var oTable = jQuery('#table_id').dataTable({
"bPaginate": false,
"bFilter": false,
"sScrollY": "600",
"sScrollX": "100%",
"sScrollXInner": "400%",
"bScrollCollapse": true
});
new FixedHeader( oTable );
[/code]
The key is to increase sScrollXInner to accommodate the width of the table. You may also need to put it in a div with overflow:auto.
UPDATE: I found the alert box code in FixedHeader.js and just commented it out. Will have to check cross-browser compatibility but it looks like everything is working in Chrome.
Allan
I realise this isn't something you're planning on adding right now, but do you have any thoughts on how scrolling containers might be implemented (within FixedHeader or in general)?
I'm currently using the workaround described above with a plain html table, i.e. listen to my container's scroll events and update the header accordingly. The only issue with this is that if the container scrolls in both directions, the header will mask the top of the vertical scrollbar. Changing the Z-index doesn't help, as I can only bring it in front of or behind the container as a whole, since the cloned table is a child of the document itself.
I've briefly experimented with adding the cloned table to elsewhere in the DOM, but haven't managed to get anything working yet. I was just wondering if there are any obvious problems with this approach, compared to positioning relative to the document as a whole?
Or could you just use the scrolling feature built into DataTables?
Allan
Thanks,
Mat