Code does not have the same behavior as the example in the guid(large js source)
Code does not have the same behavior as the example in the guid(large js source)
AluminumCat
Posts: 23Questions: 0Answers: 0
THis example is what I'm trying to re-create:
http://datatables.net/release-datatables/extras/Scroller/large_js_source.html
I don't want to use server-side code if I can get my tables to work as efficiently as in the example. However, when trying to re-create it, it doesnt show all entries at once. So i tried setting bPaginate to false. ... But that just slows it down a lot...
So is there any way to make the example work? Why does the recreated example not work the same?
Here's an example of what I mean... you can see that I have used the exact same code as the given example, but it does paginate... and if I use bPaginate its way slower.
http://live.datatables.net/ruyewir/1/edit?js
http://datatables.net/release-datatables/extras/Scroller/large_js_source.html
I don't want to use server-side code if I can get my tables to work as efficiently as in the example. However, when trying to re-create it, it doesnt show all entries at once. So i tried setting bPaginate to false. ... But that just slows it down a lot...
So is there any way to make the example work? Why does the recreated example not work the same?
Here's an example of what I mean... you can see that I have used the exact same code as the given example, but it does paginate... and if I use bPaginate its way slower.
http://live.datatables.net/ruyewir/1/edit?js
This discussion has been closed.
Replies
Scroller doesn't show all entries at once. The whole point of it is that it uses the built in paging to show only the records that are needed for the current view - that's where it gets its speed from.
See http://datatables.net/blog/Introducing_Scroller_-_Virtual_Scrolling_for_DataTables for information on how Scroller works.
Do not disable pagination with Scroller. It uses the pagination!!
Allan
http://live.datatables.net/ruyewir/2/edit
Allan
Thank you :)
The reason I want to use scroller, is because the tables might contain as many as 20.000 entries at a time(probably not more though), so the scroller-solution seems fine.
On one page, the tables are used for selecting and saving things. They are place in a form and have hidden checkboxes and radios added. The way it worked was that on the submit event, all the checked boxes would simply get sent to the server. Also classes would be added/removed to indicate which state an item is in(which is called through an API that sends JSON data to the frontend) But of course this isn't possible when scroller is activated as it ignores the rows that arent visible ... Meaning if I save my changes, and some rows that Ive clicked on arent visible, then they are just forgotten.
So is there a better, more dataTables-appropriate way to do this? Id like to avoid serverside processing as much as possible, as I'm trying to keep the server load to a minimum(lots of users will use this feature)
Allan