Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixing big with undefined value in calculations #274

Closed
wants to merge 1 commit into from

2 participants

@vmanchev

When the datatables is build dynamically, the initial state of divBody.offsetHeight is undefined and can not be used straight away in the displayBodyStyle.height calculation on line 3596. Setting its value to zero, will fix the problem.

@vmanchev vmanchev Fixing big with undefined value in calculations
When the datatables is build dynamically, the initial state of divBody.offsetHeight is undefined and can not be used straight away in the displayBodyStyle.height calculation on line 3596. Setting its value to zero, will fix the problem.
e94defa
@DataTables
Owner

Are you able to link me to a test page which shows this error so I can add it into the unit tests please?

@vmanchev
@DataTables
Owner

I've not had any other reports about this issue, and haven't been able to recreate it myself. If this is still causing problems for anyone, please post a test case and I'll look into it.

@DataTables DataTables closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 18, 2014
  1. @vmanchev

    Fixing big with undefined value in calculations

    vmanchev authored
    When the datatables is build dynamically, the initial state of divBody.offsetHeight is undefined and can not be used straight away in the displayBodyStyle.height calculation on line 3596. Setting its value to zero, will fix the problem.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  media/js/jquery.dataTables.js
View
3  media/js/jquery.dataTables.js
@@ -3590,6 +3590,9 @@
// will end up forcing the scrollbar to appear, making our measurements wrong for when we
// then hide it (end of this function), so add the header height to the body scroller.
if ( scroll.bCollapse && scrollY !== "" ) {
+ if(divBody.offsetHeight === undefined){
+ divBody.offsetHeight = 0;
+ }
divBodyStyle.height = (divBody.offsetHeight + header[0].offsetHeight)+"px";
}
Something went wrong with that request. Please try again.