[Solved] Getting the Number of Displayed QTable Rows
-
Hello.
I want to get the number of displayed Q-table rows. I use pagination, and I want the number of displayed rows updated when user click the next arrow.
In the picture above, I want to show text ‘Showing 6 from 41 data’
I found this exact dynamic data that I need available inside Q-Table component. I want to get the computedRows’ length. Is it possible to get it ?
Thanks
-
@fadhilradh using a ref for your qtable.
<q-table ... ref="table" .../> ... mounted() { this.$watch(() => { return this.$refs.table.computedRows }, (val) => { console.log('current computed rows', val.length) // number of rows shown } ) ...
-
It worked! Thanks for the solution @metalsadman. Much appreciated!