Scroller + FixedColumns scrolling inconsistency
Scroller + FixedColumns scrolling inconsistency
jhaitas
Posts: 32Questions: 0Answers: 0
When using the Scroller plugin in conjuction with the FixedColumns plugin - there is an inconsistency with the appearance the datatable when scrolling.
The FixedColumns stop scrolling at the end of the visible data subset. The scrolling part of the datatables will scroll into whitespace until the data is loaded.
I have a fix for when the datatable is loaded. I am working on integrating it back into the FixedColumns plugin so that it will work out of the box.
The FixedColumns stop scrolling at the end of the visible data subset. The scrolling part of the datatables will scroll into whitespace until the data is loaded.
I have a fix for when the datatable is loaded. I am working on integrating it back into the FixedColumns plugin so that it will work out of the box.
This discussion has been closed.
Replies
I have a fix for this that goes in FixedColumns.js ... Do you think we could get this merged into the official code? Perhaps you would see a better place/way to do this.
Thanks,
John
Regards,
Allan
diff --git a/media/js/FixedColumns.js b/media/js/FixedColumns.js
index a75e68a..14a9788 100644
--- a/media/js/FixedColumns.js
+++ b/media/js/FixedColumns.js
@@ -882,6 +882,15 @@ FixedColumns.prototype = {
}
oClone.body.style.width = "100%";
+
+ if ( bAll )
+ {
+ if ( typeof this.s.dt.oScroller !== undefined )
+ {
+ oGrid.body.appendChild( this.s.dt.oScroller.dom.force.cloneNode(true) );
+ }
+ }
+
oGrid.body.appendChild( oClone.body );
this._fnEqualiseHeights( 'tbody', that.dom.body, oClone.body );
see https://github.com/johnhaitas/FixedColumns
Just wanted to give you a nudge on this. I am happy to help testing different use cases.
Hopefully it makes it into FixedColumns 2.0.4 - would make things easier to not patch every time. :)
Cheers,
John
Any chance this can make it into 2.0.4 when you do the 1.9.2 release?
http://jsfiddle.net/jhrabows/UFGdS/11/
The is a scroller with 2 columns (1 fixed) and 100 rows generated on the client. When you scroll down past 75th column the fixed-column stops scrolling. The issue is in the 1.9.2 release although the fiddle uses 1.9.1 release from CDN.
Allan
I updated the fiddle to point to the latest Github code for FixedColumns (which is exactly what John posted on April 20.
http://jsfiddle.net/jhrabows/UFGdS/17/
I have tested on Firefox and Chrome and the original issue is no longer there but I noticed some side-effects:
1) On Firefox only I noticed a drastic change in the response to scrolling with mouse-wheel. Normally, a turn of the wheel moves the display by couple of rows, but now the display moves just few pixels.
2) On both Firefox and Chrome when the total number of rows is large (thousands) then sliding the scroll-bar with the mouse becomes erratic. In some cases the slider does not move at all, in others the move happens but only after a considerable delay.
3) On both Firefox and Chrome the horizontal scroll bar extends over the entire table and when the horizontal slider is under the 'fixed' column then the sliding is suppressed. You can however change the location of the slider by clicking.
Allan
can anyone else confirm?
Allan
I submitted a pull request that significantly improves scroll performance for me - particularly with inertial scrolling in Safari.
I hope they work for you.
Thanks,
John
Best we figure out if my existing pull request is good enough for the codebase before moving on to that.
What is the FireFox fix?
Doing a conditional event binding with just object detection (since we can't use $.browser now...) might be interesting! Possibly just need to use user agent matching anyway.
Allan
Using $().on() allowed me to bind both 'scroll' and 'mousewheel' to the same anonymous function.
Yes, there is a shorthand $().scroll() function. But there is no shorthand $().mousewheel() function.
As of jQuery 1.7 $().on() is preferred over $().bind() per http://api.jquery.com/on/
...
The Firefox fix is only for Windows - have you noticed how poor the performance is for Firefox on Windows? User agent detection is necessary because we would need to detect the OS.
...
I'd prefer to wait on the Firefox fix until we verify my existing pull request is good to go. :)
Thanks,
John