Get all the data ?

Get all the data ?

Jean123Jean123 Posts: 1Questions: 1Answers: 0
edited February 2015 in Free community support

hi,

I have noticed that the data method allow only to retrieve the data currently displayed; for example have a look on this page http://www.datatables.net/examples/basic_init/zero_configuration.html, as you can see there are 6 pages and a maximum of 10 rows are allowed to be displayed by page and there are 57 rows in total. Using data method provides a array containing 10 rows of the current page. So my question would be : how can i get the set containing all the 57 rows ?

Answers

  • allanallan Posts: 63,681Questions: 1Answers: 10,498 Site admin

    Have you tried the data() method on that page? If you open your browser's console you will see that you get the data for all rows by running:

    $('#example').DataTable().data();
    

    It sounds like you might be using server-side processing (although without a test case I'm just guessing), in which case it is correct that you can only get the data for the current page since that is the only data available on the client-side at that time (that is the whole point of server-side processing after all!).

    Allan

This discussion has been closed.