1. 程式人生 > >fastadmin中隱藏預設按鈕

fastadmin中隱藏預設按鈕

最近使用fastadmin,在專案中需要刪除自帶的編輯按鈕,沒找到刪除,找到隱藏。
程式碼如下:

{
                            field: 'operate',
                            title: __('Operate'),
                            table: table,
                            events: Table.api.events.operate,
                            // formatter: Table.api.formatter.operate
                            //隱藏編輯按鈕
                            formatter: function (value, row, index) {
                                var that = $.extend({}, this);
                                var table = $(that.table).clone(true);
                                $(table).data("operate-edit", null);
                                that.table = table;
                                return Table.api.formatter.operate.call(that, value, row, index);
                            }
                        }