I have a Tree component in Perspective with a JSON structure where each subtree is labelled with its index.
The selection
parameter in the Tree component controls which subtree is clicked during the Perspective session. This parameter selects the subtree by containing the subtree's index (ex. selection: 0/0/1/0
.)
I want to add an onStartup event to the Tree component that automatically selects the root of the Tree component by setting selection:0
, where 0
is a string, since selection
can only accept strings as values. However, when the event sets selection: 0
, Ignition immediately assumes that 0
must be an integer, which throws an error on the selection
property (integer found, string expected.
)
How can I get the props on the Tree component to accept 0
as a string? I've tried self.props.selection[0] = '0'
and self.props.selection[0] = str(0)
in the onStartup script, but Ignition seems to immediately register 0 as an integer.