Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datatables.net slow in rendering and applying paging

I am trying to implement DataTables.net 1.10.9 (http://datatables.net) in asp.net web forms. Its works great with small amount of data but it delays rendering and applying paging on web page.

I am using Repeater control and binding it in code behind page at runtime.

When page is loaded, i can see all the data in table but page is still in process and after 5-8 seconds delay paging and theme is applied on the table.

Is there any work around to reduce the rending time? (without using server side webservice)

So far i have tried using "deferRender": true but no luck.

Working okay in firefox and google chrome but delay is in IE9

like image 677
user1263981 Avatar asked Oct 26 '15 18:10

user1263981


1 Answers

SOLUTION

Use deferRender to defer rendering of non-visible rows for additional speed of initialization.

Please note that this will improve performance only for Ajax or JavaScript sourced data (i.e. when using ajax or data options).

var table = $('#example').DataTable({
    ajax: 'https://api.myjson.com/bins/qgcu',
    deferRender: true
});

If you're using HTML sourced data, consider writing a script that will produce JSON with the data. Then you can specify the path to the script with ajax option and use deferRender: true as shown above to improve performance.

DEMO

See this jsFiddle for code and demonstration.

LINKS

  • Deferred rendering for speed
like image 94
Gyrocode.com Avatar answered Sep 29 '22 08:09

Gyrocode.com