首页 > 解决方案 > 为什么 bootstrap-table 中的 showButtonIcons 不起作用

问题描述

为什么 showButtonIcons 不起作用?我希望看到文本而不是按钮图标,但并非所有图标都隐藏,示例按钮全屏和列。我将 showButtonIcons 设置为 false,将 showButtonText 设置为 true。我还包括来自 cdn 的 js 文件

<script>
    $table = $('#table')

    $table.bootstrapTable({
        url:                  '{{ route("dataBudgets") }}',
        locale:               'ru-RU',
        search:               'true',
        advancedSearch:       'true',
        pagination:           'true',
        showRefresh:          'true',
        showFullscreen:       'true',
        showColumns:          'true',
        showColumnsToggleAll: 'true',
        buttons:               buttons(),
        buttonsAlign:          'left',
        showButtonIcons:       'false',
        showButtonText:        'true',
        buttonsOrder:          ['create', 'advancedSearch', 'clearSearch', 'refresh', 'exportExcel', 'fullscreen', 'columns'],
    });

    function buttons() {
        return {
            create: {
                text: 'Создать',
                event: function () {
                    alert(1)
                },
                attributes: {
                    title: 'Добавить пользователя'
                }
            },
            clearSearch: {
                text: 'Сбросить',
                event: function() {
                    alert(1)
                },
                attributes: {
                    title: 'Сброс поиска'
                }
            },
            exportExcel: {
                text: 'Excel',
                event: function() {
                    alert(1)
                },
                attributes: {
                    title: 'Выгрузка файла'
                }
            }
        }
    }
</script>

标签: javascriptbootstrap-table

解决方案


推荐阅读