Bug - horizontal scrolling in 1.8b4

Bug - horizontal scrolling in 1.8b4

dmcleandmclean Posts: 55Questions: 2Answers: 0
edited June 2011 in General
I have a table that is fairly wide (that's what 30" monitors are for). When I changed the table settings to use vertical scrolling rather than pagination, DataTables also turned on horizontal scrolling and neglected to put scrolling on the headers.

Now it is possible that I did something wrong, but horizontal scrolling without matching scrolling for the header is still bad.

Unfortunately, I can't grant access to the application - it is an internal app with security limitations.

Thank you,

Donald

This didn't work correctly:

[code]
$(document).ready(function() {
oTable = $('#requestData').dataTable( {
"sScrollY": "300px",
"bPaginate": false
} );
} );
[/code]

Neither did this (directions say to use an empty string to turn off horiz scrolling):

[code]
$(document).ready(function() {
oTable = $('#requestData').dataTable( {
"sScrollX": "",
"sScrollY": "300px",
"bPaginate": false
} );
} );
[/code]

This did (except that I don't want horizontal scrolling):

[code]
$(document).ready(function() {
oTable = $('#requestData').dataTable( {
"sScrollX": "100%",
"sScrollY": "300px",
"bPaginate": false
} );
} );
[/code]

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi Donald,

    Thanks for the initialisation examples, however, I'm not able to replicate the issue I'm afraid. These two examples show y-scrolling being used without x-scrolling:

    1.7.6: http://datatables.net/examples/basic_init/scroll_y.html
    1.8 beta 4: http://datatables.net/beta/1.8/examples/basic_init/scroll_y.html

    Is there any chance you can put up a stripped down version somewhere (jsfiddle for example)?

    Thanks,
    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    I'm about to go on vacation but I can look at this again when I come back.

    However, I will say that my table is Really Wide, like double or triple what you have in that example.

    Thank you,

    Donald
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Width itself shouldn't really matter, unless it is clashing with something else which results in the x-scrolling being forced.

    Enjoy your holiday :-)

    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    That's exactly it. When x-scrolling is forced because the browser window is too narrow then the table body scrolls but the table header don't. This only works if the table is set up so that it resizes. The two examples above don't show the problem because their width is fixed and if the window gets two narrow you get browser x-scrolling rather than table x-scrolling.

    And just for clarity, yes, I have updated to 1.8 final.

    Thank you,

    Donald
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    edited June 2011
    An update for anyone following this discussion (the discussion was taken "offline") - this issue should now be addressed in DataTables 1.8.1 which will refuse to draw tables smaller than they can possibly be (which was the issue here).

    Allan
This discussion has been closed.