|
102 | 102 | filterAllField : '_all', |
103 | 103 | useLoadingTransition : true, |
104 | 104 | rowTemplate : null, |
| 105 | + columnTemplates : {}, |
105 | 106 | tablesorter : { |
106 | 107 | debug: false, |
107 | 108 | theme : 'bootstrap', |
|
174 | 175 | var tableElement = this.$element.find('.tablesorter'); |
175 | 176 |
|
176 | 177 | var lateDefaults = { |
177 | | - downloadButton: this.$element.find('.js-uf-table-download'), |
178 | | - onDownload: $.proxy(this._onDownload, this), |
179 | | - renderInfoMessages: $.proxy(this._renderInfoMessages, this), |
| 178 | + download: { |
| 179 | + button: this.$element.find('.js-uf-table-download'), |
| 180 | + callback: $.proxy(this._onDownload, this) |
| 181 | + }, |
180 | 182 | info: { |
181 | | - container: this.$element.find('.js-uf-table-info') |
| 183 | + container: this.$element.find('.js-uf-table-info'), |
| 184 | + callback: $.proxy(this._renderInfoMessages, this) |
182 | 185 | }, |
183 | 186 | overlay: { |
184 | 187 | container: this.$element.find('.js-uf-table-overlay') |
|
231 | 234 | infoContainer.data('message-empty-rows') : |
232 | 235 | "Sorry, we've got nothing here." |
233 | 236 | }, |
234 | | - columnTemplates: {}, |
235 | 237 | tablesorter: { |
236 | 238 | widgetOptions: { |
237 | 239 | // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows} |
|
304 | 306 | } |
305 | 307 |
|
306 | 308 | // Link CSV download button |
307 | | - this.settings.downloadButton.on('click', this.settings.onDownload); |
| 309 | + this.settings.download.button.on('click', this.settings.download.callback); |
308 | 310 |
|
309 | 311 | // Allow clicking on the labels in the table menu without closing the menu |
310 | 312 | $(this.settings.tablesorter.widgetOptions.columnSelector_container).find('label').on('click', function(e) { |
|
317 | 319 | }, this)); |
318 | 320 |
|
319 | 321 | // Show info messages when there are no rows/no results |
320 | | - this.ts.on('filterEnd filterReset pagerComplete', this.settings.renderInfoMessages); |
| 322 | + this.ts.on('filterEnd filterReset pagerComplete', this.settings.info.callback); |
321 | 323 |
|
322 | 324 | // Detect changes to element attributes |
323 | 325 | this.$element.attrchange({ |
|
494 | 496 |
|
495 | 497 | /** |
496 | 498 | * Implements handler for the "download CSV" button. |
| 499 | + * Default callback for download.callback |
497 | 500 | * @private |
498 | 501 | */ |
499 | 502 | Plugin.prototype._onDownload = function () { |
|
549 | 552 |
|
550 | 553 | /** |
551 | 554 | * Render info messages, such as when there are no results. |
552 | | - * Default callback for renderInfoMessages |
| 555 | + * Default callback for info.callback |
553 | 556 | * @private |
554 | 557 | */ |
555 | 558 | Plugin.prototype._renderInfoMessages = function () { |
|
0 commit comments