RED-3837: add deselect method
This commit is contained in:
parent
0a6b0c49bb
commit
cca7401d26
@ -120,6 +120,12 @@ export class ListingService<E extends IListable> {
|
|||||||
this.setSelected(this.selected.filter((el, idx) => idx !== currentEntityIdx));
|
this.setSelected(this.selected.filter((el, idx) => idx !== currentEntityIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deselect(entities: E | E[]) {
|
||||||
|
const _entities = Array.isArray(entities) ? entities : [entities];
|
||||||
|
const entitiesIds = _entities.map(e => e.id);
|
||||||
|
this.setSelected(this.selected.filter(el => !entitiesIds.includes(el.id)));
|
||||||
|
}
|
||||||
|
|
||||||
private _updateSelection(): void {
|
private _updateSelection(): void {
|
||||||
const items = this._displayed.filter(item => this.selected.includes(item));
|
const items = this._displayed.filter(item => this.selected.includes(item));
|
||||||
this.setSelected(items);
|
this.setSelected(items);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user