服务器端数据表在处理时崩溃

时间:2016-09-16 10:44:53

标签: datatables

我有以下代码:

<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个条目但是当我pagniate它只挂在“处理”。我知道它以与第一页相同的格式从控制台返回数据,所以我错过了什么?从手册看起来你不必设置列 - 它应该只是简单地工作??

1 个答案:

答案 0 :(得分:0)

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