Skip to content

[Table]: expose getRowId for flexible row selection #565

Description

@Martenscode

Problem

Row selection in tedi-table appears to be keyed by row index only. There's no available getRowId input to key selection state by a stable entity id, the way TanStack Table allows underneath.

This makes selection state hard to control from the outside as soon as the data isn't static (filtering, adding/removing rows etc).

Currently it is necessary to maintain a mapping of selected row indexes across updates.

Solution

Expose getRowId as an input that's passed straight through to the TanStack table options.

Examples and information

This would allow to get the rowSelection based on object data:

<tedi-table ... [getRowId]="getPersonId" />

getPersonId = (row: Person) => row.id;.

https://tanstack.com/table/latest/docs/api/core/table#getrowid

Project

DoD

  • The component is developed using best practices, conventions, and modern frontend trends
  • The component follows BEM naming conventions (if applicable)
  • The component implementation matches the Figma design, including all defined states and interactions
  • The component supports responsiveness and scales across breakpoints (if applicable)
  • The component does not introduce runtime errors or warnings
  • Linter passes
  • Component has export if needed
  • The component has unit tests with at least 80% code coverage
  • CodeCov passes minimum coverage threshold
  • The component has passed code review
  • The component has passed Chromatic visual review
  • Storybook stories are created:
    • Cover all Figma variations
    • Include edge cases, empty/error states
  • Component’s API (props, slots, events) is documented
  • ZeroHeight is updated with design/development guidelines
  • External dependencies used in the component are documented in Confluence with rationale.
  • Semantic commit format is used (for semantic-release)
  • External libraries comply with validated open source licenses
  • Component is versioned correctly and ready for release if required
  • Update statuses page in Zeroheight

Metadata

Metadata

Assignees

Labels

tedi-readyTEDI-Ready component issue

Type

No type

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions