I use yajra datatable but i've get problem when I use the method "addColumn". the one I use that method is work properly, but the other doesn't
this is my source code :
->addColumn('action', function($arrProduct){
return
'<center><a class="btn btn-success btn-sm" href="'.route('packaging.edit',['id' => $arrProduct['id'], 'product_id'=> $arrProduct['product_id']]).'">
<i class="fa fa-refresh"></i> Proses</a></center>';
})
->addColumn('status', function($arrProduct){
if($arrProduct['status_produksi']){
return ucwords($arrProduct['status_produksi']);
}else{
$tag = "<center><a class='btn btn-danger btn-sm'>
<i class='fa fa-refresh'></i>Belum Diproses</a></center>";
return $tag;
}
})
->make(true);
and this is the problem :
one of them (column action) is work properly, but why in the other (column status) the "addColumn" doesn't work?
pls somebody help me.. thank's anyway
Add ->rawColumns(['status', 'action'])
before ->make(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With