gpt4 book ai didi

codeigniter - 数据表不工作 - Ignited 数据表库

转载 作者:行者123 更新时间:2023-12-02 21:16:54 24 4
gpt4 key购买 nike

我已经使用ignited datable将其集成到codeigniter中,但出现以下错误:DataTables警告:表id=example2 - 为第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":"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0e6f6a6367604e6f6a636760206d6163" rel="noreferrer noopener nofollow">[email protected]</a>","first_name":"Admin","last_name":"istrator"},{"email":"subhadeepg<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="92f3ebf7fcd2f5fff3fbfebcf1fdff" rel="noreferrer noopener nofollow">[email protected]</a>","first_name":"Subhadeep","last_name":"Gayen"}]}

似乎可以找到任何解决方案:(

最佳答案

您好,您只需要指定列

"columns": [
{ "data": "id" },
{ "data": "name" }
]

关于codeigniter - 数据表不工作 - Ignited 数据表库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24683120/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com