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

    q-table, can I detect a row click?

    Help
    1
    4
    1163
    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
      Fancellu last edited by Fancellu

      I don’t want selection per se, just to know when user clicks on a row

      How would I do that? I want to update a detail table based on an id in the row

      I assume I could create a template for #body slot and put my logic there, but was wondering if there was a simple “onRowClick” lurking somewhere

      Thanks

      1 Reply Last reply Reply Quote 0
      • F
        Fancellu last edited by

        BTW, row slot seems to work ok, but if anyone knows a simpler way, do tell

        <template class=“row” #body=“props”>
        <q-tr :props=“props” @@click.native=“requestRowClick(props.row.id)” class=“cursor-pointer”>
        <q-td v-for=“col in props.cols” :key=“col.name” :props=“props”>
        {{ col.value }}
        </q-td>
        </q-tr>
        </template>

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

          Trouble with above solution is that it ignores my existing #body-cell-[name] slots

          Any way to “derive” q-tds instead of simply iterating on props.cols?

          1 Reply Last reply Reply Quote 0
          • F
            Fancellu last edited by

            Also, if I were to use selection=“single”, any way to make it select on row click, i.e. not demand click on checkbox ?

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