I'd like to change the row color of a grid table (sap.ui.table.Table
) based on status value. I followed the this blog post and tried but I'm not able to achieve it.
Could any one provide the suggestion how to achieve it?
Below is the xml code:
<table:Table id="Table" rows="{Dataset>/}" selectionMode="None">
<table:columns>
<!-- ... -->
<table:Column>
<Text text="Status"/>
<table:customData>
<core:CustomData key="mydata" value="{DataSet>Status}" writeToDom="true" />
</table:customData>
</Text>
<table:template>
<Text text="{DataSet>Status}" wrapping="false"/>
</table:template>
</table:Column>
</table:columns>
</table:Table>
CSS file:
tr[data-mydata="Success"] {
background: #ff3333 !important;
}