【发布时间】:2018-05-28 07:09:29
【问题描述】:
我正在处理mvc 中的jQuery datatable,我通过ajax 调用获取数据并作为预定义语法绑定到datatable。 ajax调用响应的json对象包含如图所示的嵌套数据。
我确实成功获取了根数据,但是当我尝试获取嵌套数据时,它无法显示数据。
oTable =$(".dataTables-example").DataTable({
stateSave: true,
"pagingType": "full_numbers",
"ajax": {
"url": "my_action_method_url",
"type": "POST",
"datatype": "json"
},
pageLength: 10,
responsive: true,
"columns": [
{
"mData": null,
mRender: function (data) {
return data['instituteName']; // working fine.
}
},
{
"mData": null,
mRender: function (data) {
return data['personalInfo.title']; // not working.
}
}
],
"serverSide": "true",
"order": [0, "asc"],
"processing": "true",
"language": {
"processing": "Loading data..."
}
});
【问题讨论】:
标签: ajax asp.net-mvc datatables