fastadmin默认的列表操作中只有编辑和删除按钮,如果我们需要添加其他按钮,需要先找到对应的js文件。我们需要在初始化表格中添加buutons属性,原来的js代码如下:
{ field: "operate", title: __("Operate"), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate, },
添加以后:
{ field: "operate", title: __("Operate"), table: table, buttons: [{ name: "detail", text: "撤回", //名称 title: "撤回", icon: "fa fa-list", classname: "btn btn-xs btn-primary btn-dialog", //class名称 url: "page/detail", //图片路径 },], events: Table.api.events.operate, formatter: Table.api.formatter.operate, },