How to check if the table is empty

How to check if the table is empty

lenamtllenamtl Posts: 265Questions: 65Answers: 1
edited August 2020 in Free community support

Hi,

What would be the best way to check if the table is empty?

I'm using this to count the selected items
var itemcount = table52.rows( { selected: true } ).count();

I'm looking for similare way to know if the table is empty.

Thanks

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    You could use the same technique, something like

    var isEmpty = table52.rows().count() === 0;
    

    Colin

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923

    You could use table52.rows().count();.

    You can use page.info().

    Kevin

  • lenamtllenamtl Posts: 265Questions: 65Answers: 1

    Thanks !

This discussion has been closed.