Currently, I am in the process of binding a JS KendoUI dropdownlist to JSON data without using a model. However, recently there have been some changes made by adding a named array to the object in order to format the JSON for a Kendo TreeView control. This modification resulted in breaking a few things in the process. Originally, the JSON format consisted of an array of objects structured like this:
[
{
"COLUMN_NAME": "OBJECTID",
"DATA_TYPE": "esriFieldTypeOID",
"CATEGORY": "Feature Data"
},
{
"COLUMN_NAME": "Brand",
"DATA_TYPE": "esriFieldTypeString",
"CATEGORY": "Feature Data"
},...
]
Now, the format has changed to an object with a named array containing more objects as shown below:
{
"Hydrant": [
{
"COLUMN_NAME": "OBJECTID",
"DATA_TYPE": "esriFieldTypeOID",
"CATEGORY": "Feature Data"
},
{
"COLUMN_NAME": "Brand",
"DATA_TYPE": "esriFieldTypeString",
"CATEGORY": "Feature Data"
},...
],
"DisplayField": "Description",
"DefaultField" : "HydrantID"
}
I initially thought that defining the schema to "Hydrant" or setting the dataText/ValueFields to "Hydrant.COLUMN_NAME" would work, but unfortunately, it did not. So the question arises: What aspect am I failing to consider? My objective is to bind this modified JSON response to a dropdownlist by utilizing the "COLUMN_NAME" to populate it.
As a bonus query: Is there a way to utilize the "DefaultField" to establish the default selection in the dropdownlist?
Thank you in advance!