I use addColumn to show a button but now is returning html code, it works before 7.9 version
->addColumn('status', function ($model) {
return "id]) ."' class='btn btn-sm btn-icon icon-left'> Activate";
})
i have the same problem >_<
Same here! Back to 7.8.1 for now..
Thanks for reporting, I think this was fixed on 7.9.1. Please update to the latest version.
-- edit --
Double checking. I think I already fix this issue but maybe have done it on the master.
Did you use rawColumns(['status']) on your code? See doc for ref.
@yajra Thanks! rawColumns did the trick.
@yajra thanks for you ,,
can you send an example !
Just a help to anyone:
When use ->addColumn() and ->editColumn with html content, you need set ->rawColumns(['addcolum','editcolum']) to avoid addColumn return html and editColumn return data.
Example:
->addColumn('action', function ($dtt) {
return '<a href="'.route('routename).'" class="btn btn-xs btn-primary""><i class="glyphicon glyphicon-edit"></i> '.trans('btn.edit').'</a>';
})
->editColumn('status', function($dtt) {
if($dtt->status == TRUE){
return '<span class="label label-success">'.trans('admin.status.active').'</span>';
}else{
return '<span class="label label-danger">'.trans('admin.status.inactive').'</span>';
}
})
->rawColumns(['status','action'])
->make(true);
@rubensrocha thanks! the only solution I found was to change the version of yajra to 6.6, but with this clarification, I can continue with version 8.0 of yajra
Just a help to anyone:
When use ->addColumn() and ->editColumn with html content, you need set ->rawColumns(['addcolum','editcolum']) to avoid addColumn return html and editColumn return data.
Example:
->addColumn('action', function ($dtt) { return '<a href="'.route('routename).'" class="btn btn-xs btn-primary""><i class="glyphicon glyphicon-edit"></i> '.trans('btn.edit').'</a>'; }) ->editColumn('status', function($dtt) { if($dtt->status == TRUE){ return '<span class="label label-success">'.trans('admin.status.active').'</span>'; }else{ return '<span class="label label-danger">'.trans('admin.status.inactive').'</span>'; } }) ->rawColumns(['status','action']) ->make(true);
QUESTION : is better render HTML TAGS on client side?
'.trans('admin.status.active').'
Most helpful comment
Did you use
rawColumns(['status'])on your code? See doc for ref.