Laravel 4 bllim/laravel4数据表-不工作
我第一次使用Bllim Laravel 我没有收到任何错误消息,但也无法填充datatable中的数据,我收到datatable,但其中没有数据。查询工作正常,我可以看到其中的数据,但它没有传递到Datatable,或者不是Datatable能够读取的格式 此处的投寄代码: 控制器Laravel 4 bllim/laravel4数据表-不工作,laravel-4,datatable,Laravel 4,Datatable,我第一次使用Bllim Laravel 我没有收到任何错误消息,但也无法填充datatable中的数据,我收到datatable,但其中没有数据。查询工作正常,我可以看到其中的数据,但它没有传递到Datatable,或者不是Datatable能够读取的格式 此处的投寄代码: 控制器 public function listAjax() { $posts = DB::table('newspaper')->select('id', 'no_of_pages', 'date', 'p
public function listAjax() {
$posts = DB::table('newspaper')->select('id', 'no_of_pages', 'date', 'publishing_time', 'status');
return Datatables::of($posts, true)->make();}
查看
<table id="newspaperList" class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>No of pages</th>
<th>Date</th>
<th>Publishing time</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
$("#newspaperList").dataTable({
"processing": true,
"serverSide": true,
"ajax": "http://localhost:88/epaperlaravel/public/ep-admin/newspaper/listajax",
"order": [[1, 'desc']],
"columnDefs": [{//this prevents errors if the data is null
"targets": "_all",
"defaultContent": ""
}],
"columns": [
//title will auto-generate th columns
{"data": "id", "title": "Id", "orderable": true, "searchable": false},
{"data": "no_of_pages", "title": "Name", "orderable": true, "searchable": true},
{"data": "date", "title": "Username", "orderable": true, "searchable": true},
{"data": "publishing_time", "title": "Email", "orderable": true, "searchable": true},
{"data": "status", "title": "Created", "orderable": true, "searchable": true},
]
});
});
哪里出错了?显示数据需要这么多脚本:
$(“#数据表示例”)。数据表({
b处理:对,
观察家方面:是的,
dom:“Tfrtip”,
sAjaxSource:“{{URL::to('/work/showusers')}}”,
A排序:[[0,“描述”]],
“aoColumns”:[
{'sWidth':'60px'},
{'sWidth':'130px','sClass':'center'},
{'sWidth':'180px','sClass':'center'},
{'sWidth':'60px','sClass':'center'},
],
表格工具:{
sRowSelect:“操作系统”,
阿布顿:[
{sExtends:“editor_create”,editor:editor},
{sExtends:“editor_edit”,editor:editor},
{sExtends:“editor_remove”,editor:editor}
]
},
语言:{
处理:“过程中的叛逆……”,
搜索:“Rechercher:”,
长度菜单:“附加菜单”,
信息:“附件一开始部分、结束部分、总计部分”,
infoEmpty:“在0é;lé;元素上附加0à;0 sur 0é;lé;元素”,
信息过滤:“(过滤最大值和总计),
infoPostFix:“”,
装载记录:“过程中的收费……”,
zeroRecords:“Aucuné;lé;Mintà;afficher”,
空表:“有争议的画面”,
分页:{
第一:“总理”,
上一个:“Pré;cé;凹痕”,
下一个:“Suivant”,
最后:“德尼尔”
},
咏叹调:{
Sot上升:“牛角包”
《牛角包》
}
}
} );代码>
身份证件
用户名
电子邮件
密码
身份证件
用户名
电子邮件
密码
Add->get()在查询结束时。这将执行它。就这样,;DB::table('paper')->select('id','no_of_pages','date','publishing_time','status')->get();它与get不兼容,在插件页面上,它说不要在末尾使用get,问题是什么?
Route::get('ep-admin/newspaper/listajax', array('as' => 'articlesajax', 'uses' => 'NewspaperController@listAjax'));