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: 'example/bootstraptable/detail', /*******************狀態切換開始*******************/ hidden:function(value,row){ console.log(row); if (row.name ==='details'){ return true; } }, /*******************狀態切換結束**********************/ callback: function (data) { Layer.alert("接收到回傳數據:" + JSON.stringify(data), {title: "回傳數據"}); }, visible: function (row) { //返回true時按鈕顯示,返回false隱藏 return true; } },
}