MCPcopy Create free account
hub / github.com/MADEVAL/Oat-Table / #setupSelection

Method #setupSelection

src/table.js:92–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90 }
91
92 #setupSelection() {
93 this.#selectAll?.addEventListener('change', () => this.#toggleVisibleRows(this.#selectAll.checked), { signal: this.#controller.signal });
94
95 this.#table.addEventListener('change', event => {
96 const checkbox = event.target.closest('[data-table-select-row]');
97 if (!checkbox) {
98 return;
99 }
100
101 const row = checkbox.closest('tr');
102 row?.toggleAttribute('data-selected', checkbox.checked);
103 this.#syncSelection();
104 this.#emitSelection();
105 }, { signal: this.#controller.signal });
106 }
107
108 #applyInitialSort() {
109 const active = this.#headers.find(header => ['ascending', 'descending'].includes(header.getAttribute('aria-sort')));

Callers 1

#initMethod · 0.95

Calls 3

#toggleVisibleRowsMethod · 0.95
#syncSelectionMethod · 0.95
#emitSelectionMethod · 0.95

Tested by

no test coverage detected