Skip to content

Manage uncontrolled DataTable states #1258

@ffffffelix

Description

@ffffffelix

Context / Problem to solve / Design

Feedback from Geofrey

The big piece I see currently missing is option for uncontrolled state, or maybe event listener handlers (e.g. for restoring pagination, selection, expanded states tracked by redux for example). But this could be out of scope for this PR, or is a separate story.

The current DataTable implementation assumes the entire dataset is available, but we need to handle situations where the component only receives the data to display. In that case, we cannot rely on the library to manage those states, and it will be up to the implementation to handle them.

Selection

  • We can use onRowSelectionChange and state provided by the library (tan-stack doc ) and map it to our prop onChangeSelection

Pagination

  • Provide a controlled and uncontrolled state for the pagination
  • The props from the Pagination component should be available from the DataTable
  • We should be able to add custom attributes to the DataTable Pagination

Sorting

  • Provide a controlled and uncontrolled state for the sorting

Note:

If necessary, we can separate this story into individual features.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions