Getting back all (even filtered ones)

Getting back all (even filtered ones)

vismarkvismark Posts: 79Questions: 5Answers: 0

Hi, I need to fetch back all <tr>, even those hidden by filter or pagination.

I tried rows().every() and rows().data(), but I'm obtaining only an object with the cell content from the visible rows ONLY.

This question has an accepted answers - jump to answer

Answers

  • gyrocodegyrocode Posts: 126Questions: 6Answers: 30
    edited July 2017

    By default rows() method selects rows from all pages with no filtering applied. See this example for demonstration.

    Can you please demonstrate the issue with an example or URL to your project?


    See more articles about jQuery DataTables on gyrocode.com.

  • vismarkvismark Posts: 79Questions: 5Answers: 0

    Thanks gyrocode, rows() returns an array with the cell contents. I need to fetch back all <tr> in html format. I was not clear enough in the first post, sorry.

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin
    Answer ✓

    rows().nodes() will do what you are looking for.

    Note that if you are Ajax loading the data and have deferRender enabled, then only the rows that have been drawn thus far will be given (that's kind of the point of `-init deferRender :)).

    Also, if you are using server-side processing, then you would only get the rows that are currently visible. Again, that's kind of the point of server-side processing.

    Allan

  • vismarkvismark Posts: 79Questions: 5Answers: 0

    Thanks a lot allan, this is what i was looking for! :)

This discussion has been closed.