简体   繁体   中英

rendering large server-side datasets in jquery datatables

I'm using DataTables 1.9.4 with few plugins (ColVis, ColReorderWithResize and ColumnFiltering). The parameters I'm using for server-side communication are:

  • "bServerSide"
  • "fnServerData"
  • "sAjaxSource"

Now, let's say I have to display 3000 rows with around 25 columns without pagination ("iDisplayLength": -1). The json containing the data weights around 1MB and it takes around second for server to send it to datatables.

The problem is the rendering of those 3000 rows take few seconds (around 5-10, which is unacceptable). On IE, it can take quite more, resulting in "Script doesn't respond" errors.

I wish I could speed this process up somehow - ie by showing lets say 100 rows and rendering the rest in background. Is there a better way? I know there's a Scroller plugin - Scroller , but I need all the data available for searching, so scrolling is not an option.

unfortunately, datatables aren't made for large dataset. The way around it is to use server side processing. Which means you need to implement the data to be returned based on the page index.

here are the examples:
http://datatables.net/forums/discussion/2651/alternative-server-side-php-script http://www.datatables.net/examples/server_side/server_side.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM