All table data to array.

All table data to array.

svendbersvendber Posts: 27Questions: 8Answers: 0

Hi,

I've got a table with 150.000+ rows.
It's possible to get the data like this, but only recording to how many entries showing.

var snipArray = tableSnip.rows().data().toArray(); 

However, I need it all, and if I set paging: false for the table, which will load the entire data into the table, it gives me the memory error.

That said, I do not need to show the table, but only get the data into an array. Is it possible to reduce the load or maybe an API?

Cheers.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770

    If you want to fetch all the data outside of Datatables you can use a jQuery ajax request.

    Kevin

  • svendbersvendber Posts: 27Questions: 8Answers: 0

    ty for answer @kthorngren but isn't it possible with Datatables?

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770
    Answer ✓

    but isn't it possible with Datatables?

    However, I need it all, and if I set paging: false for the table, which will load the entire data into the table, it gives me the memory error.

    Sounds like if you try to fetch all the data with Datatables you get an error.

    I do not need to show the table, but only get the data into an array.

    If you don't want Datatables to display all the data but want to place it in an array then the wayt o do this is with using jQuery ajax to fetch the data.

    Is it possible to reduce the load or maybe an API?

    See this FAQ:
    https://datatables.net/faqs/index#speed

    Kevin

This discussion has been closed.