Skip to content
Permalink
Browse files

Fix: Attempt to use the original row for row height calculations if t…

…here is only one row in the table.

Pull request #76 from sh2ezo. Thanks!
  • Loading branch information...
Allan Jardine
Allan Jardine committed Aug 1, 2018
1 parent 28f7554 commit dc272038e9923d0f312b53d5fc7880e72b3762d7
Showing with 11 additions and 3 deletions.
  1. +11 −3 js/dataTables.scroller.js
@@ -618,10 +618,18 @@ $.extend( Scroller.prototype, {
// Want 3 rows in the sizing table so :first-child and :last-child
// CSS styles don't come into play - take the size of the middle row
$('tbody tr:lt(4)', origTable).clone().appendTo( tbody );
while( $('tr', tbody).length < 3 ) {
tbody.append( '<tr><td>&nbsp;</td></tr>' );
}
var rowsCount = $('tr', tbody).length;

if ( rowsCount === 1 ) {
tbody.prepend('<tr><td>&nbsp;</td></tr>');
tbody.append('<tr><td>&nbsp;</td></tr>');
}
else {
for (; rowsCount < 3; rowsCount++) {
tbody.append('<tr><td>&nbsp;</td></tr>');
}
}

$('div.'+dt.oClasses.sScrollBody, container).append( nTable );

// If initialised using `dom`, use the holding element as the insert point

0 comments on commit dc27203

Please sign in to comment.
You can’t perform that action at this time.