MCPcopy Create free account
hub / github.com/breck7/scroll / createDatatable

Method createDatatable

external/.tableSearch.js:146–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144 }
145
146 createDatatable() {
147 this.dataTables = jQuery("table.scrollTable").DataTable({
148 paging: false,
149 stateSave: true,
150 columnDefs: this.createColumnDefs(),
151 stateSaveCallback: (settings, data) => {
152 const order = data.order.map(([column, direction]) => `${column}.${direction}`).join(this.columnDelimiter)
153 const patch = {
154 q: data.search.search,
155 order
156 }
157 this.setObjectOnHash(patch)
158 },
159 layout: {
160 topStart: {
161 buttons: ["copy"]
162 },
163 topEnd: {
164 search: {
165 placeholder: "Search"
166 }
167 }
168 },
169 search: { search: this.searchFromHash },
170 order: this.orderFromHash,
171 stateLoadCallback: settings => {
172 return {
173 search: {
174 order: this.orderFromHash,
175 search: this.searchFromHash
176 }
177 }
178 }
179 })
180 this.addExpandButtons()
181 }
182
183 addExpandButtons() {
184 let buttons = document.querySelectorAll(".buttons-copy")

Callers 1

constructorMethod · 0.95

Calls 5

createColumnDefsMethod · 0.95
setObjectOnHashMethod · 0.95
addExpandButtonsMethod · 0.95
mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected