Scroller Issue: to/from numbers wrong
Scroller Issue: to/from numbers wrong
tacman1123
Posts: 207Questions: 46Answers: 1
http://www.surveyrepository.com/phenx/domains
The table itself is working, but it's only 21 rows, yet the numbers at the bottom say
Showing 16 to 32 of 21 entries
Any idea what I'm doing wrong?
Thx,
Tac
The table itself is working, but it's only 21 rows, yet the numbers at the bottom say
Showing 16 to 32 of 21 entries
Any idea what I'm doing wrong?
Thx,
Tac
This discussion has been closed.
Replies
As an experiment could you try something like this:
[code]
"fnInitComplete": function (o) {
o.oScroller._fnCalcRowHeight();
this.fnDraw();
}
[/code]
You'll need the Scroller 1.0.1.dev nightly from the downloads page to get that to work. It will just recalculate the row height and then redraw the table with the new information.
Thanks,
Allan
http://www.surveyrepository.com/phenx/domains
BUT the numbers that it shows on the page are off, it says "Showing 1-16", but in fact it's only 1-11. The numbers aren't that important, what I'd actually prefer to see is the start and end sort column, so something like "Showing Alcohol to Nutrition", but that's not really even that important. That might be more important when moving the scoller, but I realize that's a lot more data than the index.
Anyway, this is great, thanks!
Tac
Modifying the code as follows seems to work:
[code]
--- media/js/Scroller.js (revision 11519)
+++ media/js/Scroller.js (working copy)
@@ -525,6 +525,7 @@
"_fnCalcRowHeight": function ()
{
var
+ nDiv = document.createElement('div'),
nTable = this.s.dt.nTable.cloneNode( false ),
nBody = document.createElement( 'tbody' ),
nTr = document.createElement('tr'),
@@ -534,9 +535,11 @@
nTr.appendChild( nTd );
nBody.appendChild( nTr );
nTable.appendChild( nBody );
- document.body.appendChild( nTable );
+ nDiv.className = this.s.dt.oClasses.sScrollBody;
+ nDiv.appendChild( nTable );
+ document.body.appendChild( nDiv );
this.s.rowHeight = $(nTr).height();
- document.body.removeChild( nTable );
+ document.body.removeChild( nDiv );
},
[/code]
(I work with Tac.)
Regards,
Allan
Allan