Will bDeferRender help render a large data set faster if paging is not used?

Will bDeferRender help render a large data set faster if paging is not used?

Marko76Marko76 Posts: 16Questions: 0Answers: 0
edited January 2014 in General
Hi folks,

I have a relatively large data set (150 rows with 25 columns) loaded into the datatables and I noticed that it takes browser some 2 seconds to render/display it even though server side code executed in 0.2 seconds. I was reading this post http://82.113.152.82/forums/discussion/18233/slow-rendering-of-10000-rows-/p1 which mention using bDeferRender to speed up the rendering process by allowing DataTables to defer the creation of the table elements for each row until they are needed for a draw.

So my question is does this also work if datatables paging is not enabled? I don't want my user to page through X many pages, I want all records available right away via a scroll. How does bDeferRender feature know which rows are "needed for draw"?

Here is the demo of the problem: http://screencast.com/t/sPQByOOk9oJ. As you can see the repsonse took 0.3 seconds but the DOM loading took over 2 seconds.

Also if I was to use aaData and aoColumns to define my data how would I define the footer rows data in that case? Is there a way to indicate that the data row should go to the footer row?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    No - if paging is disabled bDeferRender will not help as all rows are required for display at the same time.

    However, if you are using scrolling, then use Scroller ( http://datatables.net/extras/scroller ) which can use the built-in pagination and bDeferRender .

    Allan
  • Marko76Marko76 Posts: 16Questions: 0Answers: 0
    Allan,

    with regards to the scroller example: is it important that the data is fetched via ajax for it to work? The way I have it setup (I'm using .NET MVC) I have a partial view which is rendered in the table container. Essentially instead of fetching JSON data only and then binding that data to the table I am actually generating the entire table html on server side and sending it down the pipe. I know it's more expensive that way but I have header cells which contain HTML and I don't want to have to write HTML as data values inside JSON. MVC views allow me to avoid that scenario - use them as a template in a way.
  • Marko76Marko76 Posts: 16Questions: 0Answers: 0
    Also I'm a bit confused as to what my sDom should be. Right now I'm using colReorder and because of that my sDom value is: "Rlfrtip" So if I want to add to this the scroller feature all I need to add is S at the end of this? Is 'RlfrtipS' correct?
  • anthonybellanthonybell Posts: 4Questions: 1Answers: 0

    @Marko76, did you ever find a solution to your problem? I have some code doing the exact same thing you described (entire html table generated in a partial) and it is very slow with 1000 rows/15 columns. I was thinking to switch over to server side processing but I would prefer not to spend the time refactoring.

This discussion has been closed.