Quasar: [Request] Data Table - Allow add event to rows

Created on 5 Jan 2017  路  9Comments  路  Source: quasarframework/quasar

Something in the configuration object that could allow us to add an event to the row when is tapped/clicked.

Most helpful comment

Added @rowclick event which takes one parameter which is the selected row.
Available in future v0.14.

All 9 comments

Would the single selection mode help in your situation?

@rstoenescu

I don't think so since single selection adds an extra column and doesn't work in the entire row.

@rstoenescu

In the meantime, is there a way to create a custom cell that can listen a click event? I tried something like this but doesn't register the event:

            format (value) {
              return `<span v-on:click="doSomething(value)">${value}</a>`
            }

@eliashdezr format() should return a string indeed but that string is no compiled with Vue. Instead, see "Rendering with Component" on http://quasar-framework.org/components/data-table.html#Formatting-a-Cell

i have a few use cases for applying v-on to data-table rows too. not only click but drag and drop events as well.

Added @rowclick event which takes one parameter which is the selected row.
Available in future v0.14.

@rowclick - is this implemented? I don't find it in the docs. I find: https://quasar-framework.org/components/datatable.html#Alternative-custom-rows

@aprixon01112017 use a row scoped slot and add whatever native events you need ;)

@rstoenescu I think this scenario is pretty common in data table. Example, lists the users in data table, when it is clicked, open full user details. Rather than define the slot with no change in styling or for additional processing, emit a click event for external callback processing is really neat, as it simplifies the workflow. Hope this can be re-considered again ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexeigs picture alexeigs  路  3Comments

hctpbl picture hctpbl  路  3Comments

wc-matteo picture wc-matteo  路  3Comments

jean-moldovan picture jean-moldovan  路  3Comments

florensiuslaylim picture florensiuslaylim  路  3Comments