Count all rows in dataset

Tags: #<Tag:0x00007efc657009f0> #<Tag:0x00007efc65700810>

This feels super trivial, but what is the best way to count the grid dataset (row count)?

I’ve always thought countRows would count all rows but apparently not…
It only seems to count visible rows.

So I figured I could get the data from getSettings and count there, which shows correct count.

Is this the best way or are there any better ways?

https://jsfiddle.net/2dg5axnk/

Hi @mottosson

Yes, there is another way, I think it will suit this requirement best. The method is called countSourceRows so it will always show initial number of rows: https://jsfiddle.net/handsoncode/u142ntwd/

Ah yes, that’s what I’m looking for!

Thanks!

I’m glad I could help!