我有一個PHP腳本從數據庫中提取有效的GeoJSON數據。現在我想用jqgrid準備這些數據的網格視圖,但是我無法弄清楚JavaScript代碼的正確的jsonReader。jqgrid json geoJson reader
這是我的GeoJSON的輸出:
{"type":"FeatureCollection",
"total":0,
"page":1,
"records":117,
"features":[
{"geometry":{"type":"Point","coordinates":[12.3,41.70052]},
"type":"Feature",
"properties":{
"data":"2006-02-22",
"specie":"S. coeruleoalba",
"localita":"Ostia",
"provincia":"Roma"
},"id":0},
{"geometry":{
"type":"Point","coordinates":[15.26667,40.0502]},
"type":"Feature",
"properties":{
"data":"2006-03-01",
"specie":"S. coeruleoalba",
"localita":"Golfo di Salerno",
"provincia":"Salerno"
},"id":1},
{"geometry":{"type":"Point","coordinates":[14.88333,40.56692]},
"type":"Feature",
"properties":{
"data":"2006-03-03",
"specie":"S. coeruleoalba",
"localita":"Battipaglia",
"provincia":"Salerno"
},"id":2}
]}
使用該閱讀器我的網格顯示行(117)和頁面右邊的數字,但空單元格
jsonReader : {
root: "features",
page: "page",
total: "total",
records: "records",
repeatitems: false,
cell: "properties",
id: "id"
}
有人可以幫我寫一個工作的讀者?在此先感謝
你想在網格中有什麼列? 「物業」似乎大多不清楚。所有其他條目在數據的「屬性」部分中具有相同的「specie」,「localita」和「provincia」屬性?僅僅從一個項目就很難理解數據是如何的。你可以在''features「''數組中包含更多項目嗎? – Oleg
Thx爲答案,我添加了一些項目給我的Json – user781065
你仍然沒有寫出你需要在網格中有哪些列。 – Oleg