()
| 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") |
no test coverage detected