FastAdmin表格中添加操作按钮

{
                            field: 'buttons',
                            width: "120px",
                            title: __('试题'),
                            table: table,
                            events: Table.api.events.operate,
                            buttons: [
                                {
                                    name: 'detail',
                                    text: __('考试试题'),
                                    title: __('考试试题'),
                                    classname: 'btn btn-xs btn-primary btn-dialog',
                                    icon: 'fa fa-list',
                                    url: 'exam/exam_item/index',
                                    callback: function (data) {
                                        Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
                                    },
                                    visible: function (row) {
                                        //返回true时按钮显示,返回false隐藏
                                        return true;
                                    }
                                },
                            ],
                            formatter: Table.api.formatter.buttons
                        },

 

posted @ 2022-03-03 10:50  鲨鱼大王  阅读(931)  评论(0编辑  收藏  举报