I need to pass some data associated with individual leafs in the MenuTree and/or Tree Perspective components. I’m able to create my own custom properties and all appears to be functional, but I get this warning in Designer:
In the instance I was listing, it is using a Menu Tree component, and they don’t have a generic “data” container that I could use for custom data. In the case of the Tree component that does have the data property, yes, I could use that.
Thoughts on the Menu Tree component? I tried using the “target” property, but that had adverse effects where with an OnClick event, the Menu Tree would trigger a navigate action using the data within the target property as the URL. Like I said, I can insert my own properties within the item object, which does function, but it may be a hack given the warning in Designer, where if Ignition began more strict data-model verification, my application would be broken.
Would be good if there was a way to have that similar data property for each item in the menu tree as well. I have an application that I need to set a session property based on the menu Item you click and currently I just use the label. But it would be a bit cleaner if I could associate extra data to a menu item.
We won’t. The type validation in Perspective is deliberately as defensive as possible, since it’s all JSON ‘under the hood’, so there is no way to be stricter about it. If you’re fine with ignoring warnings in the designer, there’s basically 0% chance this validation will ever cause you any problems.
If the warnings start to pile up, then eventually it starts to cause some problems. Originally in the ad-hoc trends chart on the exchange, there was a bug that added an extra property to the Item dictionaries. This is small and ignorable, but when the page was loading several thousand tags, the amount of errors started to cause the page to really struggle. If you accidentally hovered over the warning triangle, than it would take ages trying to load thousands of error messages into the tooltip.
I am not sure if this is already fixed (This was earlier in 8, and I havent dealt with that project in a while), but if its still an issue than that would be the only problem with ignoring the warnings. @PGriffith if you look at this the bug was FB11246 and support ticket 105997, I never actually got a response that the bug was fixed so I am not sure.