Dynamic CSS attribute value

1
I have a data view with an image on it and i need to rotate the image based on an attribute value in my domain model. I tried a search online but can't find anything on how to do this. Any ideas how to do this?
asked
2 answers
0

If there's only a few values, take a look at the EnumClass widget. This will allow you to set a class based on an enum or string value. The class can be used in your CSS.

answered
1

Marco,

You can try the CSS Selector Helper Widget in the app store.

Alternatively, you could add an attribute to your domain model indicating which image to show (lets say landscape or portrait), then in your dataview, have 2 image viewers, one which is visible when your new attribute indicates landscape and one which is visible when your new attribute indicates portrait.

Hope that helps,

Mike

answered