下面代码修改了自定义按钮的两个地方
1、url改成了动态的可以从行内获取id等信息
2、visible是否显示
js复制代码{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
buttons: [
{
name: '查看订单',
text: __('查看订单'),
classname: 'btn btn-xs btn-primary btn-dialog',
icon: 'fa fa-eye',
url:function(row){
if (row.goods_order==1){
return '/SsHDgFLaBX.php/wanlshop/order/detail/id/'+row.order_id+'?dialog=1';
}else{
return '/SsHDgFLaBX.php/wanlshop/order/detail/id/1?dialog=1';
}
} ,
refresh: true ,
visible:function(row){
if (row.goods_order==1){
return true;
}else{
return false;
}
}
}
],
formatter: Table.api.formatter.operate}