Comments (9)
Can you link to a test case showing the issue please. Scroller should adjust the number of rows required before the first draw.
from scroller.
This is my table configuration:
datatable = $table.DataTable(
{
"dom": 'lCfrtiS',
"ajax": ajax,
"columns": columns,
"deferRender": true,
"lengthMenu": [10, 25, 50],
"processing": true,
"serverSide": true,
"scrollX": true,
"scrollY": "400px",
"scrollCollapse": true,
"scroller": {
"displayBuffer": 2
},
"columnDefs": [{
"searchable": false,
"orderable": true,
"targets": 0
}],
"order": [[ 0, 'desc' ]]
}
);
In the attached image you can see that until it reaches the full 26 rows requested, 10 ajax requests are made to my server requesting always some overlapped rows.
from scroller.
Sorry i close this issue by mistake
from scroller.
Can you link to a test page showing the issue please? I don't know from the above code why multiple requests would be made.
from scroller.
Hi, thanks for the reply. I think i can reproduce the error in this fiddle:
https://jsfiddle.net/amanique/28cv7e4d/4/
If you watch the console log, you can see it makes several ajax calls starting at a row it already requested previously. It is almost getting two lines at the time.
Thanks for the help
from scroller.
I don't understand this loop: for (var j = 0; j < displayBuffer; j++) {
, but other than that it appears to work as expected for me. You've got a really short display buffer which I wouldn't recommend, but that is up to you!
I would also suggest removing the page length control option since Scroller controls the page length.
The one thing that is a bit ugly in terms of multiple requests is that when the table is loaded two requests are made. That unfortunately is unavoidable - the first is DataTables default data request and the second is scroller asking for more data. I haven't yet found a good way to address that.
from scroller.
Thanks again for your reply. One last try though...
I've updated the fiddle, removing the loop you mencioned, i was just trying to generate enough data for the scroller displaybuffer, cause i didn't realize that scroller already changes the data.start. And i also increased the bufferdisplay to 10. You can test it in the same url i gave you before.
My final doubt is:
Why is scroller requesting rows it already requested before?
The first call requests 120 rows, why aren't these rows somehow cached so we can avoid so many server requests? Can't this cause server overload?
Even if i increase the buffer, the second ajax call requests, now in this updated case, 120 rows starting from the 10th. But i already have the 120 first rows, can't i ask for the next 120? Meaning start at 121 with 120 of length?
Once again thank you for your time.
from scroller.
I've found a discussion in the bugs forum that seems to be about the same problem i'm facing, yet an answer is not provided. I don't know if this issue was solved by email between you and this tommck user. But if it was could you share the solution please?
from scroller.
Why is scroller requesting rows it already requested before?
It isn't ideal, but this is just the why it is currently implemented. With server-side processing if you do a draw you need to get all data.
The first call requests 120 rows, why aren't these rows somehow cached so we can avoid so many server requests? Can't this cause server overload?
Unless your web-site is extremely popular or a very low powered server, I would say that is extremely unlikely. As I say, it is not ideal, but it is how it currently works.
There is no row caching in DataTables server-side processing by default. If you want that you would need to implement something like this example: http://datatables.net/examples/server_side/pipeline.html
Going to close this for now as it is behaving as expected, even if not perfect.
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
- Scroller not working with more than 30k rows HOT 13
- 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.