Laravel 无法使用yajra数据表显示html元素

Laravel 无法使用yajra数据表显示html元素,laravel,laravel-5,eloquent,laravel-4,yajra-datatable,Laravel,Laravel 5,Eloquent,Laravel 4,Yajra Datatable,你好, 我是一个新手,我尝试使用yajra数据表我有一个简单的问题,当我想显示我的数据表时,我得到了这个错误 “DataTables警告:table id=all_data-Ajax错误。有关此错误的详细信息,请参阅” 我的控制器是 公共函数indexUsingYajra() { 我的html代码 <table id="all_data" class="table-striped table-bordered dt-responsive nowrap tableData table_f

你好, 我是一个新手,我尝试使用yajra数据表我有一个简单的问题,当我想显示我的数据表时,我得到了这个错误 “DataTables警告:table id=all_data-Ajax错误。有关此错误的详细信息,请参阅” 我的控制器是

公共函数indexUsingYajra() {

我的html代码

 <table id="all_data" class="table-striped table-bordered dt-responsive nowrap tableData  table_for_data" cellspacing="0" width="100%">
                                <thead>
                                    <tr>
                                        <th>Id</th>
                                        <th>Name</th>
                                        <th>Image</th>
                                        <th>Total Product</th>
                                        <th>status</th>
                                        <th>action</th>
                                    </tr>
                                </thead>

                            </table>

身份证件
名称
形象
总产品
地位
行动
如果我想查看列(操作)中的链接,如果我删除了它,数据表工作正常,如果我删除了任何包含html元素的列(如(图像)或(状态)操作列工作正常,则会出现此问题。 我该怎么解决呢
thnaks

公共功能opdAllPatient(OpdModel$请求){

returndatatables::of(optdmodel::select('orderId'、'patientName'、'regNum'、'consultant'、'gender'、'regDate'、'address')
->其中('dltStatus','N'))
->addColumn('action',函数($data){
返回sprintf('
%
%
%s',
“视图”、$data['orderId']、'opdview'、'',
路由('opd.edit',['id'=>$data['orderId']]),'',
“添加”、$data['orderId']、'addpatient'、'',
“删除”、$data['orderId']、'opd-delete'、'';
})->addColumn('id',函数($data){
静态$i=1;
返回$i++;
})->editColumn(‘顾问’、函数($data){
返回$data->getConsultant->name;
})->filterColumn('consultant',函数($q,$keyword){
$q->whereHas('getConsultant',函数($q)use($keyword){
$q->where('name','LIKE',[“%{$keyword}%]”);
});
})->editColumn('regDate',函数($data){
return\Carbon\Carbon::parse($data->regDate)->format('d/m/Y');})
->使(真实);
}
            "responsive": true,
            "processing": true,
            "serverSide": true,
            "ajax": "{!!route('category.indexUsingYajra')!!}",
            "columns": [
                {data: 'id',       name: 'id'},
                {data: 'name',       name: 'name'},
                {data: 'image',       name: 'image'},
                {data: 'Total Product',       name: 'Total Product'},
                {data: 'status',       name: 'status'},
                {data: 'action',       name: 'action'},



            ]
        });
 <table id="all_data" class="table-striped table-bordered dt-responsive nowrap tableData  table_for_data" cellspacing="0" width="100%">
                                <thead>
                                    <tr>
                                        <th>Id</th>
                                        <th>Name</th>
                                        <th>Image</th>
                                        <th>Total Product</th>
                                        <th>status</th>
                                        <th>action</th>
                                    </tr>
                                </thead>

                            </table>
        return DataTables::of(OpdModel::select('orderId','patientName','regNum','consultant','gender','regDate','address')
                            ->where('dltStatus','<>','N'))
        ->addColumn('action', function($data){
        return sprintf(' <div class="btn-group btn-sm">
                <button data-toggle="tooltip modal" data-placement="auto" title="%s" data-order_id="%s" class="btn-sm %s btn btn-info btn-group  ">%s</button>     
         <a href="%s"data-toggle="tooltip" data-placement="auto" title="update" class="btn-sm btn-success">%s</a> 
        <button data-toggle="tooltip modal" data-placement="auto" title="%s" data-order_id="%s" class="btn-sm %s btn  ">%s</button>
         <button data-toggle="tooltip modal" data-placement="auto" title="%s" data-order_id="%s" class="btn-sm %s btn btn-danger" >%s</button></div>',
         "view",$data['orderId'],'opdview','<i class="fa fa-eye"></i>',
         route('opd.edit',['id'=>$data['orderId']]),'<i class="fa fa-pencil"></i>',
         "add",$data['orderId'],'addpatient','<i class="fa fa-plus"></i>',
         "delete", $data['orderId'],'opd-delete','<i class="fa fa-trash"></i>');

            })->addColumn('id',function($data){
                    static $i=1;
                    return $i++;

            })->editColumn('consultant',function($data){
                return $data->getConsultant->name;
            })->filterColumn('consultant', function($q, $keyword) {
                $q->whereHas('getConsultant',function($q) use ($keyword) {
                    $q->where('name','LIKE',["%{$keyword}%"]);
                });
            })->editColumn('regDate', function ($data){
                return \Carbon\Carbon::parse($data->regDate)->format('d/m/Y') ;})

        ->make(true);


 }