Best way to count number of selected rows?

Best way to count number of selected rows?

raquoraquo Posts: 7Questions: 3Answers: 0

I want to activate a button outside of the table if one (and only one!) row is selected. We've tried this:

searchTable.rows('.selected').data().length

But this doesn't work as it reports 2 selected if I just click another row. It reports correctly if I first deselect my current row, and then select another. But I can't expect my customers to do that, they'll just click another row...

Answers

This discussion has been closed.