admin管理员组文章数量:1122846
I’m trying to use serverSide: true with DataTables in an older CakePHP project (CakePHP Version: 2.x), but I’m running into issues. When I enable the server-side option, the table doesn’t load correctly—instead, it just displays the raw JSON response.
Here’s my JavaScript code for initializing the DataTable:
$('#tier-management-table').DataTable({ "stateSave": true, "pageLength": 200, "pagingType": 'simple', "processing": true, "serverSide": true, });
And here’s the CakePHP code I’m using to return the data as a JSON response:
$this->set(array( 'response' => $response, '_serialize' => 'response' ));
I’m new to CakePHP and not sure what I’m missing. How can I ensure that the DataTable properly loads the data from the server? Any help would be appreciated!
本文标签: javascriptHow can I use pagination in DataTable used in cakePHP2Stack Overflow
版权声明:本文标题:javascript - How can I use pagination in DataTable used in cakePHP2 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282364a1926621.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论