hide non-selected rows

hide non-selected rows

fbasfbas Posts: 1,094Questions: 4Answers: 0

How can I only show "selected" rows?

My rows are marked selected on click by applying CSS. Can I filter on rows by CSS?

https://datatables.net/examples/api/select_row.html

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    You could do this with the css operator ( tr:not('.selected') ) but I would only do this on the simplest of tables since paging, search, and row info sections would not reflect this properly.

  • fbasfbas Posts: 1,094Questions: 4Answers: 0

    thanks. I'd like to do it at the datatables level so I don't lose other functionality.

    any tips or suggestions?

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin
    Answer ✓

    A custom filter would be required for this. That's basically how rows can be removed (without actually deleting them from the table).

    You would use a custom filter in combination with rows() and the {selected: true} selector-modifier.

    Allan

This discussion has been closed.