我正在尝试从服务器加载数据表,但是数据不可见。我正在使用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
中完全存在的行。