No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [Solved] Getting the Number of Displayed QTable Rows

    Help
    2
    3
    552
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fadhilradh last edited by fadhilradh

      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.

      08e66937-e862-4ddb-89bc-0d8011a3a018-image.png

      In the picture above, I want to show text ‘Showing 6 from 41 data’

      7da501c1-e6ca-471a-acca-63bcf8314421-image.png

      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

      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @fadhilradh last edited by metalsadman

        @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
            }
          )
        ...
        

        https://codepen.io/metalsadman/pen/poNZNdy?editors=1010

        1 Reply Last reply Reply Quote 1
        • F
          fadhilradh last edited by

          It worked! Thanks for the solution @metalsadman. Much appreciated!

          1 Reply Last reply Reply Quote 1
          • First post
            Last post