【发布时间】:2020-07-05 13:49:08
【问题描述】:
我有以下 JSON:
{"contents":
[
{"mossadId":2,"empId":"999666333","id":12},
{"mossadId":4,"empId":"999666333","id":13},
{"mossadId":2,"empId":"301301301","id":14}
]
}
我已通过将此结果写入控制台来验证这一点。
然后我正在使用以下代码尝试用它制作一个表格:
var response = (data.contents); // remove containing 'contents' envelope
console.log(response);
var table12 = new Tabulator("#mossadListing", {
layout:"fitColumns",
data: response,
columns:[
{title:"organization", field:"mossaId", sorter:"string", width:100,
]
});
但我给我们提供了一张只有一列的表格,所有字段都是空的。
我做错了吗?
【问题讨论】: