开发的页面的数据源是一个deviceconn.json的一个JSON文件,通过dojo的ItemFileReadStore将其读入。
<div dojoType="dojo.data.ItemFileReadStore" jsId="deviceConnStore"
url="deviceconn.json" urlPreventCache="true">该json文件中存放了一个device列表,列出了每个device的软硬件信息和device提供的监视信息(Monitoring)。这里用了一个对象的嵌套,Monitoring这一个属性的值为一个对象。
{
"identifier":"id",
"label": "name",
"items": [
{
"type": "devices",
"id": "00000019bb2ed964000000030000082b",
"name": "cmserver1",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring":{Status: '0',StatusText: 'The health check result is healthy.', AdditionalInfo: 'Here is the additional infromation.'}
},
{
"type": "devices",
"id": "00000019bb2ed964000000030000082c",
"name": "cmserver2",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring":{Status: '1',StatusText: 'The health check result is healthy.', AdditionalInfo: 'Here is the additional infromation.'}
},
]
}现象:debug页面时发现抛出了以下错误,json文件中的数据无法被读入。dojo.data.ItemFileReadStore: Invalid item argument.发现从JSON文件中去掉Monitoring这一属性后,JSON文件可以被成功读入。
加上这一属性后,即使页面不调用这一属性,读入JSON文件时也会失败。
但是看不出这个Monitoring这一属性的写法有什么不对,请牛人帮忙看一下,谢谢!
<div dojoType="dojo.data.ItemFileReadStore" jsId="deviceConnStore"
url="deviceconn.json" urlPreventCache="true">该json文件中存放了一个device列表,列出了每个device的软硬件信息和device提供的监视信息(Monitoring)。这里用了一个对象的嵌套,Monitoring这一个属性的值为一个对象。
{
"identifier":"id",
"label": "name",
"items": [
{
"type": "devices",
"id": "00000019bb2ed964000000030000082b",
"name": "cmserver1",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring":{Status: '0',StatusText: 'The health check result is healthy.', AdditionalInfo: 'Here is the additional infromation.'}
},
{
"type": "devices",
"id": "00000019bb2ed964000000030000082c",
"name": "cmserver2",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring":{Status: '1',StatusText: 'The health check result is healthy.', AdditionalInfo: 'Here is the additional infromation.'}
},
]
}现象:debug页面时发现抛出了以下错误,json文件中的数据无法被读入。dojo.data.ItemFileReadStore: Invalid item argument.发现从JSON文件中去掉Monitoring这一属性后,JSON文件可以被成功读入。
加上这一属性后,即使页面不调用这一属性,读入JSON文件时也会失败。
但是看不出这个Monitoring这一属性的写法有什么不对,请牛人帮忙看一下,谢谢!
{
"identifier":"id",
"label": "name",
"items": [
{
"type": "devices",
"id": "00000019bb2ed964000000030000082b",
"name": "cmserver1",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring":{Status: '0',StatusText: 'The health check result is healthy.', AdditionalInfo: 'Here is the additional infromation.'}
},
{
"type": "devices",
"id": "00000019bb2ed964000000030000082c",
"name": "cmserver2",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring":{Status: '1',StatusText: 'The health check result is healthy.', AdditionalInfo: 'Here is the additional infromation.'}
}
]
}