Picture of the problem
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
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
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.