Adding vertical scrolling causes table's width to increase
Adding vertical scrolling causes table's width to increase
I've been using datatables for 7 or 8 months now on a number of pages and it's been just fantastic. This week I downloaded 1.7.1 to try out the scrolling features. It seems to work very well but I'm having an issue that I haven't been able to track down.
With vertical scroll on and when the filtered results are less than the scroll area (that is, when the vertical scroll bar disappears) the width of the table increase a bit each time the table is redrawn. If I keep typing in the Search box after the point no records are displayed, for every character I type (including backspace) the table's width keeps getting larger seemingly indefinitely.
I've tried it on a number of pages that I've been using datatables on for months and they all exhibit this behavior with scrolling. There's nothing special with the initializations:
[code]
$(document).ready( function() {
oTable = $('#mdsTable1').dataTable( {
"sScrollY": "350px",
"bJQueryUI": true,
"bAutoWidth": false,
"bPaginate": false,
"iDisplayLength": -1
});
});
[/code]
And when I pare this down to just the sScrolly line the same thing occurs.
The tables and css are also nothing fancy on the pages I've tried.
I've been over everything I can think of. Anyone have an idea? I'm probably missing something obvious...
-thanks!
Matthew
With vertical scroll on and when the filtered results are less than the scroll area (that is, when the vertical scroll bar disappears) the width of the table increase a bit each time the table is redrawn. If I keep typing in the Search box after the point no records are displayed, for every character I type (including backspace) the table's width keeps getting larger seemingly indefinitely.
I've tried it on a number of pages that I've been using datatables on for months and they all exhibit this behavior with scrolling. There's nothing special with the initializations:
[code]
$(document).ready( function() {
oTable = $('#mdsTable1').dataTable( {
"sScrollY": "350px",
"bJQueryUI": true,
"bAutoWidth": false,
"bPaginate": false,
"iDisplayLength": -1
});
});
[/code]
And when I pare this down to just the sScrolly line the same thing occurs.
The tables and css are also nothing fancy on the pages I've tried.
I've been over everything I can think of. Anyone have an idea? I'm probably missing something obvious...
-thanks!
Matthew
This discussion has been closed.
Replies
Sounds odd! Does it happen for you in this example: http://datatables.net/examples/basic_init/scroll_y_theme.html ? I've not been able to reproduce the issue there, but then I might be missing a step...
Regards,
Allan
The example page does not exhibit the same odd behavior that I'm experiencing on my own site. Since this issue hasn't been mentioned previously here, it must be something uniquely bad with my pages.
I've sent a link to you off the list to one of my pages that has this problem.
Thanks!
Matthew
I'm experiencing the same problem. I can give You access to the pages in question if you need Allan.
Also when dynamically adding rows to the table the width keeps incrementing until the scrollbar appears. When the scroll bar is there the tablewidth is constant.
with regards
Roar Lorentzen
Yes please - I'd be most interested in knowing what is going on here. See also this thread where is has been reported: http://datatables.net/forums/comments.php?DiscussionID=2881 .
I can't reproduce it in my example though: http://datatables.net/examples/basic_init/scroll_y.html , so there is some interaction going on that I'm not aware of. If you could give me the simplest possible example which shows the issue, that would be superb.
Thanks,
Allan
.dataTables_wrapper {
width: 700px;
}
I'm not sure if this is a general fix or just something that worked in my particular case, but it worked for me.
Matthew
thanks