Something in the configuration object that could allow us to add an event to the row when is tapped/clicked.
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 ;)
Most helpful comment
Added
@rowclickevent which takes one parameter which is the selected row.Available in future v0.14.