这是我与 Fusion Tables 测试版一起使用的代码(下面是 Oleg 去年帮助我的 jqGrid 代码的一部分):
jsonReader: {
repeatitems: false,
cell: "", // the same as cell: function (obj) { return obj; }
root: "table.rows",
page: function (obj) { return 1; },
total: function (obj) { return 1; },
records: function (obj) { return obj.table.rows.length; }
},
这是从 Google 返回的 OLD JSON 数据:
jQuery16406014587786572121_1350317794100(
{"table":
{
"cols":
["id","latitude","longitude","name","address_line_1","address_line_2","address_line_3","postcode"],
"rows":
[[1234,"55",-1.5, --etc
使用 Google 的新 API,返回的 JSON 现在如下所示:
{
"kind": "fusiontables#sqlresponse",
"columns": [
"id",
"latitude",
"longitude",
"name",
"address_line_1",
"address_line_2",
"address_line_3",
"postcode"
],
"rows": [
[
"1234",
"55",
-1.5,
"Name One",
"Road 1",
"Road 2",
"Sunderland",
"SR1 1AA"
],
它似乎没有“根”,我无法弄清楚如何让 jsonReader 与这个新的 JSON 一起工作。我有一个谷歌,看看其他人是否遇到过这个问题,但只有一两个未回答的点击。爪哇。谁能帮帮我?