Q-table, @row-click not work within body-slot
See original GitHub issueWhat happened?
see as title said if useing body-slot in q-table, the event @row-click never work…
What did you expect to happen?
Im tring to use body-slot manage user clicked row bgc/border color, cuz no api to set this prop. Thus, try to use body-slot :class=‘is_current_clicked_row’, however the api @row-click never worked.
Reproduction URL
https://codepen.io/pen?&editors=101
How to reproduce?
<q-table
title="Treats"
:rows="rows"
:columns="columns"
row-key="name"
@row-click="current_clicked_row" //here
>
<template v-slot:body="props">
<q-tr :props="props">
........... see https://quasar.dev/vue-components/table#body-slots
setup () {
let current_clicked_row = (evt, row, index)=>{
console.log(index); // no data in console...
}
return {
current_clicked_row,
columns,
rows
}
}
…
Flavour
Quasar CLI (@quasar/cli | @quasar/app)
Areas
Components (quasar)
Platforms/Browsers
Chrome
Quasar info output
V2.5.5 + VUE3
Relevant log output
No response
Additional context
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
using table row @click event not working - Quasar forum
Hi i am trying to add some @click event on every table rows of my data table please help me. here is what...
Read more >jQuery table row click not working - Stack Overflow
I was checking a few sites, and I came up with the below: <table class="admin_table"> <thead> < ...
Read more >Table | Quasar Framework
The QTable Vue component allows you to display data in a tabular manner and it's packed with a lot of related features. It's...
Read more >How to get a slot when a row of a QTableWidget is clicked
Hi! I need a way in which where the user clicks a whole row (not only a cell) I can execute a function....
Read more >Quasar QTable 'body-cell-name' slot is not recognized
This issue relates to https://youtrack.jetbrains.com/issue/WEB-52117. The IDE does not recognize the slot name as shown in the screenshot: image.png.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
follow what Milos suggested.
Hi @gowy222,
Make sure your data has a unique id and specify it in your q-table using the row-key prop