Make Pagination and Search hide rows instead of deleting them from DOM

Make Pagination and Search hide rows instead of deleting them from DOM

giaccogiacco Posts: 4Questions: 0Answers: 0

I am reading table values from DOM with javascript to add my calculations.

When i use Pagination, Pagination's select or Search input the non matching rows get deleted from DOM.

How can i hide(display: none) those rows instead?

Thanks

Replies

  • kthorngrenkthorngren Posts: 21,183Questions: 26Answers: 4,925

    I'm not sure what you are exactly doing but maybe this will help. When Datatables initializes it stores the data in an internal data cache. Datatables only places in the DOM the rows being displayed on the page. During paging, searching or sorting the DOM rows will be swapped out for the current page data. You can access the DOM element of any cell, whether displayed or not, using cell().node() or cells().nodes()`.

    If you still need help please post more info about what you are doing. Or better a link to your page or a running test case so we can see the solution in action.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • giaccogiacco Posts: 4Questions: 0Answers: 0

    I'll try to access live data using cell().node()/cells().nodes() thanks

Sign In or Register to comment.