Laravel-datatables: I want to add two columns each containing HTML

Created on 31 May 2018  路  2Comments  路  Source: yajra/laravel-datatables

Picture of the problem
ssssssssssss

I want to add two columns each containing HTML

=> this Controller

public function getPosts()
{
$users = DB::table('demo_posts')->select('*');
return Datatables::of($users)->addColumn('action', function ($users) {
return view('admin.datatable.buttons',compact('users'))->render();

          })->addColumn('option', function ($users) {
           return    view('admin.datatable.option',compact('users'))->render();
       })->make(true);
}

=> this ajax

  • Operating System : windows 10
  • PHP Version : 7.0.0
  • Laravel Version : 5.5
  • Laravel-Datatables Version : 8.6
question

Most helpful comment

You need to use raw columns for cell that have html content. See https://yajrabox.com/docs/laravel-datatables/master/raw-columns for ref.

All 2 comments

You need to use raw columns for cell that have html content. See https://yajrabox.com/docs/laravel-datatables/master/raw-columns for ref.

Done :: Thank You Very much

Was this page helpful?
0 / 5 - 0 ratings

Related issues

techguydev picture techguydev  路  3Comments

ghost picture ghost  路  3Comments

hohuuhau picture hohuuhau  路  3Comments

jackrsantana picture jackrsantana  路  3Comments

josiahke picture josiahke  路  3Comments