This is my code that worked with the beta of Fusion Tables (below is part of the jqGrid code that Oleg helped me with the other year):
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; }
},
and here is the OLD JSON data returned from Google:
jQuery16406014587786572121_1350317794100(
{"table":
{
"cols":
["id","latitude","longitude","name","address_line_1","address_line_2","address_line_3","postcode"],
"rows":
[[1234,"55",-1.5, --etc
With the new API from Google, the JSON returned now looks like this:
{
"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"
],
It doesn’t seem to have a ‘root’, and I couldn’t work out how to get the jsonReader to work with this new JSON. I have had a Google around to see if others have run into this, but only one or two unanswered hits re. java. Can anyone help me out please?
I see only that “table” part are removed from the JSON response. So I suppose you can try the following
jsonReader:Additionally you can include
id: 0injsonReaderor usekey: truefor the"id"column definition (incolModel).By the way I don’t think that
repeatitems: falseis correct setting for the old format of data.