Summary of problem or feature request
I want send to the table some HTML tags like
I use editColumn to add some HTML code to this column
its work with addColumn
but not with editColumn
the question is how I can send HTML elements to table from controller the example above didn't show the HTML tags when I need to view label
Code snippet of problem
public function CustomerTicketAjax(Request $request, $id){
$tickets = Customer::find($id);
return Datatables::of(CustomerTicket::with('user')->where('customer_id', $tickets->id))
->editColumn('status', function ($tickets) {
if ($tickets->status == 1) {
return '<span class="label bg-red" style="font-size: 21px;">open</span>';
} elseif ($tickets->status == 0) {
return '<span class="label bg-red" style="font-size: 21px;">close</span>';
};
})
->make(true);}
System details
- MAC OSX
- PHP 7.1
- Laravel 5.4
- Laravel-Datatables 7.*