cancel
Showing results for 
Search instead for 
Did you mean: 

sap.ui table change color of specific rows

Former Member
0 Kudos
12,462

Consider a table with 50 records. visibleRowCount is set to 15, so when table is loaded with data there are only 15 records displayed. I need to change color of some specific rows based on values (lets say when a cell has value "Total"). Assume, "Total" appears in rows 2,4 8. I can change the color of these rows. getRows() works well before I start scrolling a table down,The problem is that getRows() method returns only # of visible rows in the table. Therefore, when I scroll table down the rows 2, 4 ,8 are colored permanently. In this case the logic that it should depend on value "Total" doesn't work. Is thre any chance I can fix this issue? Thanks!

View Entire Topic
santhu_gowdaz
Active Contributor
0 Kudos

<m:Texttext="{myColumn}" wrapping="false" class="{=${color}=='yes'?'tableColor':''}">

css file :-

.tableColor{ background-color:#f9f9c2 !important; font-weight: bold; }

Refer : -

https://sapui5.hana.ondemand.com/#/api/sap.ui.core.Control/methods/addStyleClass

0 Kudos

Thanks Santhosh. Also I tried this solution exactly, with Text but it doesn't work ... I don't know. Any idea?

<Text text="{modelo>propiedad}"  wrapping="false" class="{= ${modelo>propiedad}=='si'?'colorClass':''}" > </Text>

The sergeyzh solution works well, but i have an Input and doesn't work.

Regards