Comments (13)
Thank you - this is something I'm planning to look at either today or tomorrow depending on how things do. Its a known bug in the current release I'm afraid.
from scroller.
Hey Allan, is there a version which doesn't have this issue?
from scroller.
I reproduce the issue and I’m very interested by the fix !
As Andrew, to wait the fix, I’m interested by knowing which version doesn’t have this issue.
from scroller.
Can you try the version that is available in git just now please? That should address the problem.
from scroller.
I just tried the very last version on master, but it didn't work :(
it is strange : I get classical pagination, instead of scrolling...
I'm based on official "Client-side data source (50,000 rows)".
BTW, the same example works great with version 1.4.4.
Here's my HTML code :
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/scroller/1.5.1/css/scroller.dataTables.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://raw.githubusercontent.com/DataTables/Scroller/master/js/dataTables.scroller.js"></script>
<script language="javascript">
$(document).ready(function() {
var data = [];
for ( var i=0 ; i<50000 ; i++ ) {
data.push( [ i, i, i, i, i ] );
}
$('#example').DataTable( {
data: data,
deferRender: true,
scrollY: 200,
scrollCollapse: true,
scroller: true
} );
} );
</script>
</head>
<body>
<table id="example" class="display nowrap" style="width:100%">
<thead>
<tr>
<th>ID</th>
<th>First name</th>
<th>Last name</th>
<th>ZIP / Post code</th>
<th>Country</th>
</tr>
</thead>
</table>
</body>
</html>
from scroller.
from scroller.
Thank you for the tip.
I just tested it and it works better.
But it's still not perfect.
Compared to v1.4.4, there is still a regression : if I set scrollY: 600
, I get this result (on Firefox, Chrome and IE11) :
from scroller.
Thanks! I'll look into this can get back to you. I removed a draw after initialisation, and I think that will be the cause of this.
from scroller.
Having the same issue but with far less rows ~6,000. I am loading the data via ajax.
Scroller options:
deferRender: true,
scrollY: 600,
scrollCollapse: true,
scroller: {
rowHeight: 40,
boundaryScale: 0.5,
displayBuffer: 3
},
In testing, it looks like the issue is in how data tables is calculating the size of the the scroll body. I have found that I can get the strips to disappear if I do the following in firefox (latest version as of commenting)
- After table has been loaded with strips visible, Open developer tools (Ctrl+shift+K) so that it is docked to the bottom
- Scroll the data tables up and down while developer tools is open
- Close Developer tools,
- When you scroll strips will no longer appear
from scroller.
Further Investigations, the problems seems to be on on how prerow is calculated in _scroll() currently the nightly is doing.
var preRows = Math.ceil( ((this.s.displayBuffer-1)/2) * this.s.viewportRows );
On initial load this creates a rather large preRow value. I found the problem is easily fixed if I just remove the multiplication and use
var preRows = Math.ceil((this.s.displayBuffer-1)/2);
If this suits you, I can create a formal pull request.
from scroller.
+1 to this. Seeing the problem with 60k rows on server side. Info panel displays the correct visible rows, but Scroller doesn't seem to take the hint that it needs to load new records. I was in a position where I could only look at the minimized version, but it does definitely seem to be in the scroll function.
1.5dev does seem to work, but when it restores the prior scroll position you can't scroll back up to earlier records, so I can't use that even if I wanted to. Seems like an option to not save the scroll state would be nice.
from scroller.
I had similar issue with similar initialization (scroller plugin v2.0.0, client side).
I found the issue was on the 'init.scroller' listener where the measure( false ) called before the table was first render, therefor the viewport (clientHeight) was not set correctly and it was small number (19 in my case) and when devided by row.height (42) + 1 it just return 1, so what I got in: this.s.dt._iDisplayLength was 1 * this.s.displayBuffer,
but the scroller should trigger table redraw after many more rows.
I managed to fix it by changing the init.scroller to be:
dt.on( 'init.scroller', function () {
//that.measure( false );
that._draw();
that.measure( true );
// Update the scroller when the DataTable is redrawn
dt.on( 'draw.scroller', function () {
that._draw();
});
} );
after the table was initially drawn it had the correct viewport and all the calculations were fine.
from scroller.
Thanks for info. Could you make a PR to fix the problem generally?
from scroller.
Related Issues (20)
- Scroller, Responsive and scrollCollapse HOT 1
- Scroller does not work with i18n HOT 4
- Binding scroller with mCustomScrollbar() HOT 1
- Install with composer HOT 1
- Viewport height change doesn't change 'showing' rows HOT 6
- Drag to the end, dynamically generate serial error, the first column HOT 2
- <object> tag in IE HOT 3
- Push 1.4.4 version on bower repository
- Unnecessary scrollbar when scrollCollapse is true HOT 17
- The "stateSave" option doesn't work HOT 7
- Scroller + export buttons = partial data dump HOT 4
- Scroller shows strange behaviour on ajax reload while keeping scroll position HOT 1
- Problem With Padding in header... HOT 6
- Columns are miss-aligned when zoomin in/out with the browser HOT 1
- Feature request: A way to show a skeleton screen while adding more content HOT 1
- row.child("some htmls").show() is not working with scrolling pagination
- Scroller wrong `types` and no `module` field HOT 1
- InfoFiltered hidden when filtering HOT 1
- Table is not rendering all records. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scroller.