After an extensive search on Google, I stumbled upon a hidden method to access the computedRows
and computedRowsNumber
properties...
- To unlock these properties, assign a ref to your table:
<q-table ref="table" />
- You can then access these properties using the ref:
This discovery was made with the release of v2.0.0-beta.9 (March 8, 2021)
Insight
computedRows
-- provides the rows currently displayed on the page
- For instance, if there are 30 total results but only 10 are visible on the current page, this property will return those 10 rows. If you need all rows, consider checking out filteredSortedRows
filteredSortedRows
-- offers all the displayed rows across all pages
- For example, if there are 50 rows in total, with 30 matching the filter criteria and displaying, this property will give you those filtered 30 rows. In case there is no filtering, it will return all 50 original rows
computedRowsNumber
-- indicates the total count of displayed rows across all pages
- equivalent to
filteredSortedRows.length
Note that these properties may behave differently when server-side data fetching is enabled. While I haven't tested this myself, I had to peek at the source code for insights.
Source | Original Discovery