is there a way to change sScrollY after initiation ?
is there a way to change sScrollY after initiation ?
is there a way to change sScrollY after initiation ?
lets say i did
[code]
$(table).dataTable({
"sScrollY": "220px",
});
[/code]
is there a way to remove that and allow the table to go max height ?
i know if i remove the height with JS it makes it look like the sScrollY is gone, but ones you do anything that will redraw the table it get fixed and back to the initial value.
So is there any other way to cancel sScrollY on the fly ? maybe with redraw or something.
Thanks
lets say i did
[code]
$(table).dataTable({
"sScrollY": "220px",
});
[/code]
is there a way to remove that and allow the table to go max height ?
i know if i remove the height with JS it makes it look like the sScrollY is gone, but ones you do anything that will redraw the table it get fixed and back to the initial value.
So is there any other way to cancel sScrollY on the fly ? maybe with redraw or something.
Thanks
This discussion has been closed.
Replies
Allan
[code]if (typeof $dataTable !== 'undefined') {
var windowHeight = $(window).height();
// Minimum scrolling height in px
var minScroll = 200;
// The sum of the heights of the controls and thead plus an extra margin
var offsetHeight = 30 + $('#table_filter').height()
+ $('div.dataTables_scrollHead').height();
// Check if the window is too small to resize
if ( windowHeight <= (offsetHeight + minScroll) ) {
$dataTable.fnSettings().oScroll.sY = minScroll+'px';
} else {
$dataTable.fnSettings().oScroll.sY = (windowHeight - offsetHeight)+'px';
}
// Actual resize with given height
$dataTable.fnSettings().oScroller.fnMeasure();
}[/code]
I call this on ready and resize events. Don't know if it's optimal or not, but it works for me.