Jquery数据表分页不更新

时间:2014-12-15 23:02:39

标签: jquery datatables server-side

我将这个json返回到我的数据表,它将数据添加到表中,但条目是0到0的0。我不确定它是否是我的错误部分或其插件的错误,但根据他们的文档,它看起来是正确的。

https://datatables.net/manual/server-side

桌子的图片 http://tinypic.com/r/2vdqjxz/8

的Javascript

 $('#query-results-table').dataTable({
            "processing": true,
            "serverSide": true,
            "ajax": webroot + "AdminQueryBuilder/PreviewQueryResultProcessing?QueryID=" + queryID
    });

C#Model

public class ReturnedDataTableParameter
    {
        public int draw { get; set; }

        public int recordsTotal { get; set; }

        public int recordsFiltered { get; set; }

        public List<List<string>> data { get; set; }

    }

JSON:

{
"draw": 1,
"recordsTotal": 200,
"recordsFiltered": 200,
"data": [
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
],
[
"1",
"Y",
"RS14:35"
]
]
}

1 个答案:

答案 0 :(得分:0)

我实际上已经解决了问题。数据表后来在同一个元素的页面上重新声明,这导致了这个奇怪的问题。