Open eriemens opened 7 years ago
+1 after my tests "watch" keyword is very-low-usable, and need some rework with functionality.
+1 as well, I've been struggling to get this to work for a while now with no luck
+1
+1 Need a way to redraw the form without destroying, which also destroys the watch!
@dzg This repo is no longer active. All work has been moved to this official fork: https://github.com/json-editor/json-editor
Hi guys,
I found this is insteresting:
schema:
{
"type": "object",
"properties": {
"possible_colors": {
"type": "array",
"format": "table",
"items": {
"type": "object",
"properties": {
"text": {
"type": "array",
"format": "table",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string",
"title": "File"
}
}
}
},
"primary_color": {
"type": "string",
"watch": {
"colors": "possible_colors"
},
"enumSource": [
{
"source": "colors",
"value": "{{item.text}}"
}
]
}
}
}
},
"primary_color": {
"type": "string",
"watch": {
"colors": "possible_colors"
},
"enumSource": [
{
"source": "colors",
"value": "{{item.text}}"
}
]
}
}
}
Assume the following schema:
The myDefault properties would need to select from a list of "p" values, where "p" is a string property of a nested array in myArray. Therefore, I added a watch to the nested array using the
NESTED_ID
id of the items in myArray as source, and using the{{item.p}}
template in the value of the enumSource.Unfortunately, this doesn't work: the json editor outputs and empty array of values in the myDefault property, as shown here. Can you shed some light on how I can watch and use values in a nested array?