|
|
@@ -74,12 +74,13 @@
|
|
|
return
|
|
|
}
|
|
|
const $btnGroup = this.$toolbar.find('>.btn-group')
|
|
|
- let $export = $btnGroup.find('div.export')
|
|
|
+ this.$export = $btnGroup.find('div.export')
|
|
|
|
|
|
- if ($export.length) {
|
|
|
+ if (this.$export.length) {
|
|
|
+ this.updateExportButton()
|
|
|
return
|
|
|
}
|
|
|
- $export = $(`
|
|
|
+ this.$export = $(`
|
|
|
<div class="export btn-group">
|
|
|
<button class="btn btn-${o.buttonsClass} btn-${o.iconSize} dropdown-toggle"
|
|
|
aria-label="export type"
|
|
|
@@ -93,7 +94,9 @@
|
|
|
</div>
|
|
|
`).appendTo($btnGroup)
|
|
|
|
|
|
- const $menu = $export.find('.dropdown-menu')
|
|
|
+ this.updateExportButton()
|
|
|
+
|
|
|
+ const $menu = this.$export.find('.dropdown-menu')
|
|
|
let exportTypes = o.exportTypes
|
|
|
|
|
|
if (typeof exportTypes === 'string') {
|
|
|
@@ -206,5 +209,17 @@
|
|
|
doExport()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ updateSelected () {
|
|
|
+ super.updateSelected()
|
|
|
+ this.updateExportButton()
|
|
|
+ }
|
|
|
+
|
|
|
+ updateExportButton () {
|
|
|
+ if (this.options.exportDataType === 'selected') {
|
|
|
+ this.$export.find('> button')
|
|
|
+ .prop('disabled', !this.getSelections().length)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
})(jQuery)
|