datatables json结果未正确加载请求的未知参数'0'

时间:2018-09-20 14:00:53

标签: ajax datatables asp.net-core-2.1

我正在尝试从服务器加载数据表,但是数据不可见。我正在使用Asp.Net Core 2.1.0,Bootstrap 4.1.3。

var dataObject = {
                columns: [
                    { title: "Col1" },
                    { title: "Col2" },
                    { title: "Col3" },
                    { title: "Col4" },
                    { title: "Col5" },
                    { title: "Col6" }
                ]
            };
    $.ajax({
                url: "/Remote/Pay",
                type: "GET",
                contentType: "application/json; charset=utf-8",
                datatype: JSON,
                success: function (result) {
                   $('#table2').DataTable({
                    "data": result,
                    "columns": dataObject.columns //Also Here i want to dynamically assign Col Names
                   });                        
                }
});

Datatables错误为Requested unknown parameter '0' for row 0, coloumn 0,但它完全不加载ajax result中完全存在的行。

0 个答案:

没有答案