/** * @author zhixin wen * https://github.com/wenzhixin/bootstrap-table/ * theme: https://github.com/jgthms/bulma/ */ $.extend($.fn.bootstrapTable.defaults, { classes: 'table highlight', buttonsPrefix: '', buttonsClass: 'waves-effect waves-light btn', iconsPrefix: 'material-icons', icons: { paginationSwitchDown: 'grid_on', paginationSwitchUp: 'grid_off', refresh: 'refresh', toggleOff: 'tablet', toggleOn: 'tablet_android', columns: 'view_list', detailOpen: 'add', detailClose: 'remove', fullscreen: 'fullscreen' } }) $.fn.bootstrapTable.theme = 'materialize' $.BootstrapTable = class extends $.BootstrapTable { initConstants () { super.initConstants() this.constants.classes.buttonsGroup = '' this.constants.classes.buttonsDropdown = '' this.constants.classes.input = 'input-field' this.constants.classes.input = '' this.constants.classes.paginationDropdown = '' this.constants.classes.buttonActive = 'green' this.constants.html.toobarDropdow = [''] this.constants.html.toobarDropdowItem = '
  • ' this.constants.html.pageDropdown = [''] this.constants.html.pageDropdownItem = '
  • %s
  • ' this.constants.html.dropdownCaret = 'arrow_drop_down' this.constants.html.pagination = [''] this.constants.html.paginationItem = '
  • %s
  • ' this.constants.html.icon = '%s' } initToolbar () { super.initToolbar() this.handleToolbar() } handleToolbar () { if (this.$toolbar.find('.dropdown-toggle').length) { this.$toolbar.find('.dropdown-toggle').each((i, el) => { $(el).attr('data-target', $(el).next().attr('id')) .dropdown({ alignment: 'right', constrainWidth: false, closeOnClick: false }) }) } } initPagination () { super.initPagination() if (this.options.pagination && !this.options.onlyInfoPagination) { this.$pagination.find('.dropdown-toggle') .attr('data-target', this.$pagination.find('.dropdown-content').attr('id')) .dropdown() } } }