Import of large amount of rows

Import of large amount of rows

tallentallen Posts: 2Questions: 0Answers: 0
edited March 2010 in General
I have the need to import 1000s of records into a datatable. This process currently takes a large amount of time to complete. I'm using the fnAddData method to add a record. Is there a better way to import this many records?

Replies

  • emjay2emjay2 Posts: 10Questions: 0Answers: 0
    I don't understand why you would need fnAddData, that would only makes sense if you are adding stuff after the page has already been rendered.

    you should probably take a look at http://datatables.net/usage/ again

    the easiest usage, and probably th best way to get started is to follow the dom example

    when you have lots of rows, or want more control, take a look at server side processing
  • tallentallen Posts: 2Questions: 0Answers: 0
    I am adding records after the page has been rendered. The problem I'm running into is that when using the fnAddData method it performs the sorting and filtering. I can add the records by adding the rows to the DOM. The problem I run into is that when I run fnDraw it doesn't redraw the table with the new records.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    How are you calling fnAddData - if you do it by passing 'false' as the second argument, DataTables will not redraw the table for every new row - this is good for speed. Then when that is complete, call fnDraw() which will do the sort and everything else for you. Hopefully that will give a speed boost.

    How many 1000s of rows are you dealing with? Might sever-side processing be possible?

    Allan
This discussion has been closed.