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(MdTable): reactive selection #1358

Merged
merged 8 commits into from Dec 29, 2017
Merged

feat(MdTable): reactive selection #1358

merged 8 commits into from Dec 29, 2017

Conversation

VdustR
Copy link
Member

@VdustR VdustR commented Dec 29, 2017

BREAKING CHANGE: no more md-selected event from MdTableRow because of too many duplicated events on a selection. It should be emitted only from MdTable both in single and multiple selecting mode. It was emitted from MdTableRow in single and from MdTable in multiple before.

Feature

new props :md-selected-value.sync for reactive selection.

  <md-table v-model="people" md-card md-sort="name" :md-selected-value.sync="selected" @md-selected="onSelected">

Notice that disabled row could be selected from :md-selected-value.

fix #1292

Refactor & fix

MdTable.selectedItems, MdTable.selectable change type to array for easier selection controlling.

Selection is determined by instance comparing now.

It was determined by comparing ids in single selection mode and comparing indexes in multiple selection mode before. The indexes way is not sorting the checkbox while sorting because the item is change and index is not. And it could also make duplicated items in selectedItems or selectable.

fix #1348

an easy way to handle multiple selection

fix #1348
…of id comparing

both `MdTable` and `MdTableRow` emit `md-selected` event to avoid breaking change
too many duplicated events on a selection. It should be emit from `MdTable`

BREAKING CHANGE: no more `md-selected` event from `MdTableRow`
@VdustR VdustR changed the title feat(MdTable): reactive feat(MdTable): reactive selection Dec 29, 2017
@marcosmoura marcosmoura merged commit 906a91d into vuematerial:dev Dec 29, 2017
@VdustR VdustR deleted the fix_table_selection branch December 29, 2017 18:21
@FossPrime
Copy link
Contributor

Reactivity is a bit weird https://codesandbox.io/s/lp7117wylq it only works after next tick... should be built in

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.

[MdTable] Table Select-All Issue [MdTable] pre select items with selection
3 participants