fastadmin 列表一些常用参数

PHP / 6人浏览
url: location.href + '&type=' + type,
pk: 'id',
toolbar: '#' + toolbar,
sortName: 'id',
fixedColumns: true,
fixedNumber: 2, // 固定左侧几列
fixedRightNumber: 1, // 固定右侧几列
search: false, // 禁用右上角快速搜索框
showExport: false, // 禁用导出Excel按钮
showColumns: false, // 禁用显示/隐藏列按钮
showToggle: false, // 禁用卡片/列表视图切换按钮
commonSearch: true, // 保留通用搜索(可选,设false则连通用搜索也关)
pageList: [10, 15, 20, 25, 50],
// 在这里添加 rowStyle;设置整行的样式
rowStyle: function(row, index) {
// 根据字段值设置颜色
return { css: { 'background-color': "#000000" } };
},
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id'), visible: false, operate: false},
{field: 'name', title: __('Name'), operate: false,
// 在这里添加 cellStyle;设置当前行与当前列的样式
cellStyle: function(value, row, index, field) {
return {
css: {
"max-width": "160px",
"width": "160px",
"padding": "5px",
"background-color": "#000000",
"white-space": "nowrap",
"text-overflow": "ellipsis",
"overflow": "hidden",
"cursor": "pointer"
}
};
}
},
]
]
上一篇:fastadmin 动态自定义弹窗中的 area 的值
下一篇:没有了