return count of table?

return count of table?

mihomesmihomes Posts: 150Questions: 19Answers: 0
edited April 2014 in DataTables 1.10
I'm sure this a stupid question, but what is the easiest way to return the length (number of rows) in the table at any given time? I want apply a condition for empty / !empty as well as pass the value in an ajax post.

Replies

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    edited April 2014
    `fnGetData().length` in 1.9, `rows().eq(0).length` in 1.10.

    Allan
  • mihomesmihomes Posts: 150Questions: 19Answers: 0

    Allan,

    I just realized this only returns the count on the current page (using server-side)... what about the entire results count.

    Showing 1 to 10 of 12 entries

    Would return length as 10 because I am only showing 10 results on the page... how can I return 12?

This discussion has been closed.