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)

AluminumCatAluminumCat Posts: 23Questions: 0Answers: 0
edited March 2014 in General
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

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > However, when trying to re-create it, it doesnt show all entries at once.

    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
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Just took a look at your link. It wasn't working, because you hadn't included Scroller :-)

    http://live.datatables.net/ruyewir/2/edit

    Allan
  • AluminumCatAluminumCat Posts: 23Questions: 0Answers: 0
    Oh... duh :p ... I didnt realize it was making use of the scroller as I had gotten to that page through a link... so the only sign that it was using the scroller was the url.. which I didnt read.

    Thank you :)
  • AluminumCatAluminumCat Posts: 23Questions: 0Answers: 0
    Actually I have an additional question which i hope you can help me with.

    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)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Have a look at this example: http://datatables.net/release-datatables/examples/api/form.html

    Allan
This discussion has been closed.