I have two views. The "SelectableList" is a flex repeater with some styling. Items in this flex repeater are the "ListItem" view. I need to highlight the item on click/touch, which is easy. I am struggling with removing that styling when the user click another item, as only one item should be selected at a time.
Here are some screenshots of the related views
Embedded "SelectableList" view:
Selectable List View:
ListItem View:
You have a number assigned to each item. Pass that number out to a custom property on the holding container. (You might use a message handler for this.) Pass the number back into each view as a parameter and create an expression binding on the view's props.style to detect if it's the selected view (number = viewNumber
). Set the appropriate style if true and the default if false.
1 Like
This worked a charm. In order to implement it, I have to change how I run some of my scripts, but I needed to clean up some code anyway. Thank you!
Good work. If you're not doing it already, create the styles in Project Browser | Perspective | Styles and reference these in the view's props.style
, or wherever. It makes maintaining visual consistency much, much easier.
See Perspective Built-In Themes | Ignition User Manual.