Skip to content

Add optional onClick property/handler to RplDataTable header cells #1639

@bgilhome-now

Description

@bgilhome-now

Describe the feature

There are use cases for being able to wrap data table header cells in a button with an onClick handler - e.g. to be able to sort data (with possible request to fetch data).

Motivation

EPA required sortable data in the data tables used in some registers of the PublicRegister component (used on e.g. https://www.epa.vic.gov.au/public-registers?register=permissions). Currently this is achieved by overriding the RplDataTable component, however it would be preferable to remove this override if this feature were implemented.

Proposal

Add onClick optional property to RplDataTable and if provided, wrap header cells in a button and attach the onClick event listener/handler.

Benefits

A benefit is the possibility for more advanced data table interactions, like sorting.

Drawbacks

DGS may wish to/require review any custom implementations of the feature.

Adoption strategy

No breaking changes, behaviour same as current if property undefined/empty.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be created outside of Ripple-framework as a layer?

Final checks

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions