0
votes

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 - i.e. 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.

1
The Datatables search will scan the full dataset even if you are using pagination.pmandell
Think about the following idea: create the table using pure jquery, showing 50 results. Then add a "show more results" button. Each time the user clicks on this button you load more 50 more rows from the database and append to the already existing table.EduardoFernandes
I need to have all the rows drawn for browser searching (Ctrl+F), and that's why I want to render the table in background. It shouldn't take too much time and I could display some kind of message saying the table is rendering.Marcin
Wouldn't it be better to have a search input and a button? it makes more sense, doen't it?EduardoFernandes

1 Answers

1
votes

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