【发布时间】:2020-07-15 13:54:19
【问题描述】:
如果数据是对象内的数组,我试图弄清楚如何写数据的列名
如果 json 返回看起来像
"data" : {
"name" : "aaa"
}
我将使用此代码
ajax : {
url : url,
type : 'GET'
},
"scrollX" : true,
destroy : true,
columns : [ {
data : 'name'
}, ]
但是如果 json 返回看起来像这样呢
"data" : {
"detail" : [
{
"name" : "abc"
}
]
}
我尝试在下面编写此代码,但它不起作用,有人可以帮我解决这个问题
ajax : {
url : url,
type : 'GET'
},
"scrollX" : true,
destroy : true,
columns : [ {
data.detail : 'name'
},
]
【问题讨论】:
标签: ajax datatable datatables