Skip to content

Commit

Permalink
feat(entity table): allow multiple selections
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget authored and mbarbeau committed Feb 20, 2019
1 parent d214d32 commit 3b4f1d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ export class EntityTableComponent implements OnInit, OnDestroy, OnChanges {
*/
onRowSelect(entity: object) {
if (this.selection === false) { return; }
this.store.state.update(entity, {selected: true}, true);

const many = this.template.selectMany ? this.template.selectMany : false;
this.store.state.update(entity, {selected: true}, !many);
this.entitySelectChange.emit({selected: true, entity});
}

Expand Down
1 change: 1 addition & 0 deletions projects/common/src/lib/entity/shared/entity.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface EntityOperationState {
export interface EntityTableTemplate {
columns: EntityTableColumn[];
selection?: boolean;
selectMany?: boolean;
sort?: boolean;
valueAccessor?: (entity: object, property: string) => any;
rowClassFunc?: (entity: object) => {
Expand Down

0 comments on commit 3b4f1d9

Please sign in to comment.