Hello
I'm using the ListView to display different items. The item should have a different back color depending on the status of the item.
I was able to change the background-color of a element within the <li> by doing something like this:
<div ${data.Status == 0 ? "style=\"background-color:orange;\"" : (data.Status == 1 ? "style=\"background-color:darkred\"" : "style=\"background-color:darkgreen\"")}></div>
But here I still have the borders of the <li> element. Therefore I would like to set the background-color directly in the <li> element to solve the issue.
Is there a way to set the background-color of the ListItem depending on my Status-Property?
I found a way how to access the css of the parent.
http://stackoverflow.com/questions/258317/jquery-changing-background-of-parent-div
But somehow I wasn't able to use this in the template.
Thanks in advance!
Kind Regards
Bruno
I'm using the ListView to display different items. The item should have a different back color depending on the status of the item.
I was able to change the background-color of a element within the <li> by doing something like this:
<div ${data.Status == 0 ? "style=\"background-color:orange;\"" : (data.Status == 1 ? "style=\"background-color:darkred\"" : "style=\"background-color:darkgreen\"")}></div>
But here I still have the borders of the <li> element. Therefore I would like to set the background-color directly in the <li> element to solve the issue.
Is there a way to set the background-color of the ListItem depending on my Status-Property?
I found a way how to access the css of the parent.
http://stackoverflow.com/questions/258317/jquery-changing-background-of-parent-div
But somehow I wasn't able to use this in the template.
Thanks in advance!
Kind Regards
Bruno