Hello,
I get this example
https://datatables.yajrabox.com/eloquent/add-edit-remove-column
to make for any row in datatable several buttons, like:
get())
->editColumn('action', '<a href="/admin/articles/edit/{{$id}}"><i class="voyager-edit"></i></a>')
->editColumn('action_delete', '<a href="#" onclick="javascript:deleteArticle()"><i class="voyager-trash"></i></a>')
->make(true);
and in template :
columns: [
...
{ data: 'action', name: 'action', orderable: false, searchable: false },
{ data: 'action_delete', name: 'action_delete', orderable: false, searchable: false }
But I see the second column as a text:
https://imgur.com/a/Ru1HC2l
Which is the right way? I need to add several buttons of similar type...
Thanks!
Hi @sergeynilov,
On latest version, you need to specify columns with html using:
->rawColumns(['action', 'action_delete'])
action is escaped by default but if multiple columns have html, you need to redeclare it on the array.
See https://yajrabox.com/docs/laravel-datatables/master/raw-columns for ref.
seems to be an issue through other areas
https://github.com/yajra/laravel-datatables/issues/1898
Most helpful comment
Hi @sergeynilov,
On latest version, you need to specify columns with html using:
actionis escaped by default but if multiple columns have html, you need to redeclare it on the array.See https://yajrabox.com/docs/laravel-datatables/master/raw-columns for ref.