Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a `_trClass` and / or `_trAttr` property to <b-table> items #1864

Closed
kbirk opened this issue Jun 1, 2018 · 2 comments · Fixed by #4481 or mariazevedo88/hash-generator-js#24 · May be fixed by tghelere/CL#8
Closed

Add a `_trClass` and / or `_trAttr` property to <b-table> items #1864

kbirk opened this issue Jun 1, 2018 · 2 comments · Fixed by #4481 or mariazevedo88/hash-generator-js#24 · May be fixed by tghelere/CL#8

Comments

@kbirk
Copy link

@kbirk kbirk commented Jun 1, 2018

Currently there are the tdClass and tdAttr properties for the table fields. It would be really nice to have something similar for the table items. Such as _trClass or _trAttr per item which would be injected in each row in the table.

My use case requires injecting a row-unique value into each row's DOM element to interface with another 3rd party library. This row-unique value is not displayed in the table so I can't acheive this in a roundabout way using the existing tdClass / tdAttr callback functions.

@tmorehouse

This comment has been minimized.

Copy link
Member

@tmorehouse tmorehouse commented Mar 22, 2019

Use the table primary-key option to enable a unique ID per row, which is based on the table's ID and the value of the field that is specified by the primary-key. The primary key field needs to exist in your data, but doesn't need to be displayed in the table itself.

@jackmu95 jackmu95 changed the title Add a `_trClass` and / or `_trAttr` property to table items. Add a `_trClass` and / or `_trAttr` property to <b-table> items Apr 9, 2019
jackmu95 added a commit that referenced this issue Dec 10, 2019
…ow attributes (closes #1864) (#4481)

* feat(b-table): add custom row attributes

Adds a trAttr attribute to b-table, which can either be an object or a function
An object is added straight to the attributes of each row
A function gets passed each item and is expected to return an object

* Change attribute order so ARIA attributes don't get overwritten

* Add implementation version to package declaration

* Add implementation version to package declaration

Missed second one...

* Update mixin-tbody-row.js

* Update mixin-busy.js

* Update mixin-bottom-row.js

* Update mixin-empty.js

* Update mixin-top-row.js

* Update package.json

* Update index.d.ts

* Update README.md

* lint

* Update index.d.ts

* Update mixin-tbody-row.js
@tmorehouse tmorehouse added this to To do in 2.2.0 via automation Dec 10, 2019
@tmorehouse tmorehouse moved this from To do to Done in 2.2.0 Dec 10, 2019
@tmorehouse

This comment has been minimized.

Copy link
Member

@tmorehouse tmorehouse commented Jan 9, 2020

BootstrapVue v2.2.0 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2.2.0
  
Done
2 participants
You can’t perform that action at this time.