fastadmin后台:在表单操作项添加操作按钮并控制弹出页面的大小

1.进入对应目录:eg(public/assets/js/backend/conmpany.js)

2.在field:'operate' 中添加buttons 

源码:

{field: 'operate', title: __('Operate'), table: table,
                        buttons: [
                            {
                                name: 'detail',
                                text: __('企业产品管理'),
                                title: __('企业产品管理'),
                                classname: 'btn btn-xs btn-primary btn-dialog',
                                icon: 'fa fa-list',
                                extend: 'data-area=\'["80%", "80%"]\'',
                                url: 'company_goods?company_id={ids}',
                                callback: function (data) {
                                    Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
                                },
                                visible: function (row) {
                                    //返回true时按钮显示,返回false隐藏
                                    return true;
                                }
                            }
                        ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}
 
3.其中   extend: 'data-area=\'["80%", "80%"]\'',    为设置点击后弹出页面的大小

posted on 2020-05-18 14:55  缈影  阅读(1866)  评论(0编辑  收藏  举报