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

Method #init

src/table.js:43–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 #init() {
44 this.#table = this.querySelector('table');
45 this.#tbody = this.#table?.tBodies[0];
46
47 if (!this.#table || !this.#tbody) {
48 console.warn('ot-table: Missing table or tbody element');
49 return;
50 }
51
52 this.#filter = this.querySelector('[data-table-filter]');
53 this.#status = this.querySelector('[data-table-status]');
54 this.#selectedStatus = this.querySelector('[data-table-selected]');
55 this.#selectAll = this.querySelector('[data-table-select-all]');
56
57 this.#setupSort();
58 this.#setupFilter();
59 this.#setupSelection();
60 this.addEventListener('ot-table-refresh', () => this.refresh(), { signal: this.#controller.signal });
61
62 this.refresh();
63 this.#applyInitialSort();
64 }
65
66 #setupSort() {
67 this.#headers = Array.from(this.#table.querySelectorAll('thead th[data-sort]'));

Callers 1

connectedCallbackMethod · 0.95

Calls 5

#setupSortMethod · 0.95
#setupFilterMethod · 0.95
#setupSelectionMethod · 0.95
refreshMethod · 0.95
#applyInitialSortMethod · 0.95

Tested by

no test coverage detected