cancel
Showing results for 
Search instead for 
Did you mean: 

Applying style to DataTable Row items using style is not working

Girish_KR
Explorer
0 Kudos

I have a scenario where DataTable Row items style needs to be shown in different colors based on status. Even though the Rule is returning correct style, still all items are being displayed in same color ie. the color of 1st item.

{"Value": "{status}", "DisplayType": "Text","NumberOfLines": 2,"TextAlignment": "left","Styles": { "Text": "/Parle_CRM_Approvals/Rules/RequestsStyleApprovalStatus.js" }}

.DataTableTextItem_Approved { font-color: #188918; font-style: body; font-size: 13;}
.DataTableTextItem_Pending { font-color: #f1d54a; font-style: body; font-size: 13;}
View Entire Topic
robinkuck
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Girish,

the style properties seem to be wrong. Instead of font-color you need to use color. You can check following page for details: https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/features/fiori-...

BR, Robin

Girish_KR
Explorer
0 Kudos

Thanks for the response kucki99, but the issue is still there.

.DataTableTextItem_Pending { color: #f1d54a; font-style: body; font-size: 13;}
I am following https://help.sap.com/doc/3642933ef2e1478fb1578ef2acba4ae9/Latest/en-US/reference/schemadoc/Page/Sect...
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

girish.kumar123

Can you share what you have in RequestsStyleApprovalStatus.js?

Girish_KR
Explorer
0 Kudos

jitendrakumar.kansal

export default function RequestsStyleApprovalStatus(context) {
var code = context.binding.status_code; var style = "DataTableTextItem_Default"; if(code==null || code ==="" ) return style switch(code){ case "P": style="DataTableTextItem_Pending"; break; case "A": style="DataTableTextItem_Approved"; break; case "R": style="DataTableTextItem_Rejected"; break; case "H": style="DataTableTextItem_Hold"; break; } return style;}
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

This appears to be a bug to me. Please open a support ticket for further investigation. See here for the details.