我使用了ignited datable将它集成到codeigniter中,但却出现了以下错误:DataTables警告:table id = example2 - 请求的未知参数' 0' 0第0行。
$(document).ready(function() {
$('#example2').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sServerMethod": "POST",
"sAjaxSource": "<?php echo base_url()?>auth/datatable"
} );
} );
这是我的HTML
<table id="example2" class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Class</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
这里是json生成的
{"draw":0,"recordsTotal":2,"recordsFiltered":2,"data":[{"email":"admin@admin.com","first_name":"Admin","last_name":"istrator"},{"email":"subhadeepgayen@gmail.com","first_name":"Subhadeep","last_name":"Gayen"}]}
似乎可以找到任何解决方案:(
答案 0 :(得分:4)
您好,您只需要指定列
"columns": [
{ "data": "id" },
{ "data": "name" }
]
答案 1 :(得分:1)
你试过这个吗 - http://ellislab.com/forums/viewthread/160896/
还有这个 - http://www.ahmed-samy.com/php-codeigniter-full-featrued-jquery-datatables-part-1/
如果你成功,请告诉我。
最佳