adopted-ember-addons/ember-light-table

Allow use of a model attribute as the row's selected state property

Open

#151 opened on Aug 24, 2016

View on GitHub
 (14 comments) (0 reactions) (0 assignees)JavaScript (130 forks)github user discovery
enhancementhelp wantedideas-wantedmaybe-breakingnew-feature

Repository metrics

Stars
 (312 stars)
PR merge metrics
 (PR metrics pending)

Description

If possible, it would be great to be able to specify the name of an attribute on a row's associated content/model that is used to hold the row's selected state, with the actual row.selected property just becoming a computed alias of that.

Currently, you need to jump through a few hoops, setup observers/ect, if you want to persist row selection state on the row models and keep them in sync (e.g. when models are added to the table and are already in a selected state).

Additionally, I think it could make sense to expose row selection/deselection actions that get fired passing the array of affected rows to the action handler, instead of only being able to observe the table.selectedRows property. This would be useful for executing side effects, like saving selection state changes to the backend, as opposed to trying to use a table.selectedRows observer where its harder to determine what changes actually occurred.

Contributor guide