支持defaultToolbar自定义

This commit is contained in:
2023-02-25 09:54:52 +08:00
parent a358cc4ae9
commit 9ce7dc1b45

View File

@@ -261,13 +261,19 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
options.limit = options.limit || 15; options.limit = options.limit || 15;
options.limits = options.limits || [10, 15, 20, 25, 50, 100]; options.limits = options.limits || [10, 15, 20, 25, 50, 100];
options.cols = options.cols || []; options.cols = options.cols || [];
if (options.defaultToolbar !== false) {
options.defaultToolbar = (options.defaultToolbar === undefined && !options.search) ? ['filter', 'print'] : ['filter', 'print', { var defaultToolbar = ['filter', 'print'];
if (options.search) {
defaultToolbar.push({
title: '搜索', title: '搜索',
layEvent: 'TABLE_SEARCH', layEvent: 'TABLE_SEARCH',
icon: 'layui-icon-search', icon: 'layui-icon-search',
extend: 'data-table-id="' + options.id + '"' extend: 'data-table-id="' + options.id + '"'
}]; })
}
if (options.defaultToolbar === undefined) {
options.defaultToolbar = defaultToolbar
} }
var table2card = function () { var table2card = function () {