Json 制表器无法识别列?
我有以下JSON:Json 制表器无法识别列?,json,tabulator,Json,Tabulator,我有以下JSON: {"contents": [ {"mossadId":2,"empId":"999666333","id":12}, {"mossadId":4,"empId":"999666333","id":13}, {"mossadId":2,"empId&qu
{"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,
]
});
但是我得到了一个只有一列的表,所有字段都是空的
我做错什么了吗?如果要指定列,则
字段的名称必须与对象键匹配。您的数据包括:
“摩萨德”
该字段的名称为:
“摩萨德”
请注意缺少的“d”
您还只定义了一个字段/列。如果要查看其余部分,需要将它们添加到列中