Utilizing the tutorial provided here, I am in the process of creating an application to retrieve JSON data from a specific URL and showcase it. The code snippet below is what I'm using to access the URL and parse the data.
{
xtype: 'nestedlist',
title: 'Blog',
iconCls: 'star',
cls: 'blog',
displayField: 'title',
store: {
type: 'tree',
fields: ['uuid', 'display'],
root: {
leaf: false
},
proxy: {
type: 'scripttag',
url: 'http://localhost:8081/openmrs-standalone/ws/rest/v1/location',
reader: {
type: 'json',
rootProperty: 'results'
}
},
},
}
The response in the console looks like this:
{
"results": [
{
"uuid": "c0937f0c-1691-11df-97a5-7038c432aabf",
"display": "Chulaimbo",
"links": [
{
"uri": "http://localhost:8081/openmrs-standalone/ws/rest/v1/location/c0937f0c-1691-11df-97a5-7038c432aabf",
"rel": "self"
}
]
},
{
"uuid": "c0937d4f-1691-11df-97a5-7038c432aabf",
"display": "Mosoriot Hospital",
"links": [
{
"uri": "http://localhost:8081/openmrs-standalone/ws/rest/v1/location/c0937d4f-1691-11df-97a5-7038c432aabf",
"rel": "self"
}
]
},
{
"uuid": "8d6c993e-c2cc-11de-8d13-0010c6dffd0f",
"display": "Unknown Location",
"links": [
{
"uri": "http://localhost:8081/openmrs-standalone/ws/rest/v1/location/8d6c993e-c2cc-11de-8d13-0010c6dffd0f",
"rel": "self"
}
]
}
]
}
However, there seems to be an error stating that "location" is the name of the service.