PDA

View Full Version : Problem in configuring json reader



anshu_gupta
19 Jan 2011, 3:32 AM
Hi,
I have a webservice whose Json Response is:
{
"devices": {
"@uri": "\/api\/dms\/device\/list-all",
"@size": "2",
"device": [
{
"@uri": "\/api\/dms\/device\/list-all",
"key": 1,
"deviceName": "PE3-re1",
"deviceId": 360464,
"ipAddress": "116.197.178.29",
"platform": "MX480",
"displayName": "PE3-re1",
"osVersion": "10.4R1.9",
"description": "MX480 Device",
"active": true,
"hostName": "PE3-re1",
"isMonitored": true
},
{
"@uri": "\/api\/dms\/device\/list-all",
"key": 2,
"deviceName": "116.197.179.12",
"deviceId": 720900,
"ipAddress": "116.197.179.12",
"platform": "SRX5600",
"displayName": "116.197.179.12",
"osVersion": "10.3R2.8",
"description": "SRX5600 Device",
"active": true,
"hostName": "116.197.179.12",
"isMonitored": true
}
]
}
}
I want to show this data in Gridpanel.
How to configure the Json reader for this data.

Thanks.

Condor
19 Jan 2011, 3:47 AM
root: 'devices.device',
totalProperty: 'devices["@size"]',
fields: [
{name: 'uri', mapping: '@uri'},
'deviceName',
'deviceId',
...
]