Vuetify: [Feature Request] VDataTable: Add per-row classes when using item.<name> slots

Created on 8 Aug 2019  路  4Comments  路  Source: vuetifyjs/vuetify

Problem to solve

Currently you can add classes to rows by using the item slot and providing the content for your entire row. However, by switching to the default item slot you lose a lot of convenience provided by the item.<name> slots, like mobile-friendly rows. In my case, I want to add colors to different rows based off different statuses associated with each item.

Proposed solution

Perhaps the headers prop could have something like rowClassKey (bad name) which points to a key within each item that has the classes that should be added to its row.

VDataTable feature

Most helpful comment

Maybe item-class="foo" and items: [{..., foo: 'class1'}, {..., foo: 'class2'}], default item-class value could be just "class"

All 4 comments

Maybe item-class="foo" and items: [{..., foo: 'class1'}, {..., foo: 'class2'}], default item-class value could be just "class"

@jacekkarczmarczyk Look like item-class does not work.
I have added item-class = 'rowclass' and add for each item rowclass: 'app-test-row-class'. But TR tags don't have any class on my datatable.

Was this page helpful?
0 / 5 - 0 ratings