【问题标题】:Server Side datatable crashes on processing服务器端数据表在处理时崩溃
【发布时间】:2016-09-16 10:44:52
【问题描述】:

我有以下代码:

<script type="text/javascript">
    $(document).ready(function(){
        $('#browseListings').DataTable({
           "processing":"true",
           "serverSide":"true",
           "ajax":"http://localhost//htdocs/index.php/admin/ajaxbrowse"
         });
    });
</script>

<table border="0" cellpadding="2" cellspacing="1" class="datable_table display" id="browseListings">
    <thead>
        <tr>
        <th>Company Name</th><th>Country</th><th>Listing Type</th>   <th>Actions</th></tr>
    </thead>
</table>    

在页面加载时,它正确地为我提供了前 10 个条目,但是当我分页时,它只是挂在“处理中”。我知道它以与第一页相同的格式从控制台返回数据,所以我错过了什么吗?从手册看来,您不必设置列 - 它应该只是工作??

【问题讨论】:

  • 控制台肯定会显示错误,请显示出来。
  • 在 JS 控制台或 firebug 中都没有错误

标签: datatables


【解决方案1】:

好的,这里的问题是draw需要增加,我已经将它硬编码为1!我正在使用我自己的自定义服务器端脚本并包含 draw 但未将其设置为与入站匹配(尽管按照建议将其转换为 int )。

【讨论】:

  • 感谢分享您的答案
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-10-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多