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

feat(data-table): dispatch on:click:header--select event #1453

Merged
merged 2 commits into from Aug 17, 2022

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Aug 17, 2022

Follow-up to #1450

#1450 added a dispatched event click:row--select for selectable rows.

This PR adds an additional event when using a batch selectable DataTable, where clicking the checkbox in the header will either select or deselect all rows. A similar event would be click:header--expand for a batch expandable DataTable.

Compared to click:row--select, one difference in the e.detail API is that the checkbox state can be indeterminate.

// indeterminate
0 < n < rows.length - 1

Sample usage

<DataTable
  batchSelection
  on:click:header--select={(e) => {
    console.log("header--select", e.detail.selected); // boolean
    console.log("header--select", e.detail.indeterminate); // boolean
  }}
/>

@metonym metonym merged commit f794cb5 into master Aug 17, 2022
@metonym metonym deleted the datatable-header-select branch August 17, 2022 17:19
@metonym
Copy link
Collaborator Author

metonym commented Aug 17, 2022

Released in v0.69.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant