Vuetify: [Documentation] unclear value description for row:click event

Created on 15 Jul 2020  路  3Comments  路  Source: vuetifyjs/vuetify

Problem to solve

Currently, the row:click event only emits an item, but according to the documentation, the row:click event emits the following object

any, {
  expand: (value: boolean) => void,
  headers: TableHeader[],
  isExpanded: boolean,
  isMobile: boolean,
  isSelected: boolean,
  item: any,
  select: (value: boolean) => void
}

which is not really clear to me what it means.
For example, if I want to do something based on whether the current row is selected, as the user clicks the row, it would be nice if I can access the isSelected property from the event emitted.

Proposed solution

Have the row:click event emit the following object instead of just the item that contains the data associated with the row:

{
  expand: (value: boolean) => void,
  headers: TableHeader[],
  isExpanded: boolean,
  isMobile: boolean,
  isSelected: boolean,
  item: any,
  select: (value: boolean) => void
}
VDataTable documentation

Most helpful comment

event has 2 arguments, first is the item, second is related data
https://codepen.io/jkarczm/pen/ZEQqExg?editable=true&editors=101

All 3 comments

event has 2 arguments, first is the item, second is related data
https://codepen.io/jkarczm/pen/ZEQqExg?editable=true&editors=101

Ill add a note to the description to clarify.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Webifi picture Webifi  路  3Comments

milleraa picture milleraa  路  3Comments

smousa picture smousa  路  3Comments

ricardovanlaarhoven picture ricardovanlaarhoven  路  3Comments

dohomi picture dohomi  路  3Comments