Hello,
I am doing a call to an API in a custom property in perspective and the pulling information from there for other custom properties.
My question, is there a way to display/utilize a Custom Property Object in a Perspective View? I'm basically looking for some component that allows you to bind the custom property to it and include all of the dropdowns just as they are displayed in the properties window.
See example image of the structure below:
One other thing to note is that the displayed structure is dynamic, meaning the same defects are not always there and new ones can pop up from the API.
Consider converting the custom property to JSON and displaying it in a text area.
I think the closest you can get with the expansions is the tree component
Object
[
{
"label": "Defects",
"expanded": true,
"data": "",
"items": [
{
"data": "",
"label": "Wr1_LiftIsOff_Error",
"expanded": true,
"items": [
{
"data": "WR1-Bottom Lift roll is not enabled",
"label": "Comment",
"expanded": true,
"items": [
{
"label": "WR1-Bottom Lift roll is not enabled",
"expanded": false,
"data": {},
"items": []
}
]
},
{
"label": "Code",
"expanded": true,
"data": {},
"items": [
{
"label": "WR1_LiftIsOff_Error",
"expanded": false,
"data": {},
"items": []
}
]
},
{
"label": "EndingMeterMark",
"expanded": true,
"data": {},
"items": [
{
"label": 436.46814,
"expanded": false,
"data": {},
"items": []
}
]
}
]
}
]
}
]
which would look like this (icons can be customized)
It would also require you to transform your data.
Another option is to just format it as JSON, example of this is here: Ideal way to display objects on a screen - Ignition - Inductive Automation Forum
2 Likes
I tried this and the plain text does not look appealing or as easy to look at for an operator.
So I've played with the Tree a bit too and the issue i run into is the Defects coming in being dynamic. Meaning they constantly change based on the product run. Sometimes there's no defects and sometimes there's a few. I think i could maybe make this work if there was a way to make each item within the tree visible/invisible if they were actual a defect for that coil.
Is there a way to do this? Or should i start looking into building something from scratch?
I would recreate the tree data from scratch each time the API call updates. Loop over the data and format it the way the tree wants it.
You don't have to worry about unused items doing this.
1 Like