/
eb
/
js-excel
Обзор
Документация
Войти
/
eb
/
js-excel
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/components/table/TableSelection.js
36 строк
700 B
Evgeniy Budaev
Finish redux and table logic
16 июн 2020, 10:52
16 июн 2020, 10:52
b7d4906
Код
Авторство
О чём код?
export class TableSelection { static className = 'selected' constructor() { this.group = [] this.current = null } // $el instanceof DOM === true select($el) { this.clear() $el.focus().addClass(TableSelection.className) this.group.push($el) this.current = $el } clear() { this.group.forEach($el => $el.removeClass(TableSelection.className)) this.group = [] } get selectedIds() { return this.group.map($el => $el.id()) } selectGroup($group = []) { this.clear() this.group = $group this.group.forEach($el => $el.addClass(TableSelection.className)) } applyStyle(style) { this.group.forEach($el => $el.css(style)) } }