I am having a table with some values and need to give colors based on some conditions .For instance if my status is In progress it should show the column 1 as Orange color and if status is Approved it should show column in Green color and if rejected it should show red color. I will attach sample picture below on how I need output.
Hi Priya Mv ,Please added important in your styles. I attached pic for your reference and OML also. I hope it helps you.regards,Venkatesaiya k
It's working , Thank you.
Hi priya ,If my answer is useful ,Please mark as a solution.Thanks in advance.regards,Venkatesaiya
Hi @Priya Mv
Yes you can able to do that
First click on the row cell you want to change color
then in right side properties, double click on style class
Using "If" you can give whatever the style you want based on condition. You can use nested if for multiple conditions.
I hope it will help you.
Regards
Murali
Could you please provide one if condition and share the output.
@Priya Mv Here is the screenshot for my if condition
and this is the output
I added container and give this if condition in that style class.
Based on your need you can write your own style class and give it inside if condition
Hi Priya Mv,In style case if(Staus=Entities.Entity1.Inprogres,"Classname1",if(Staus=Entities.Entity1.Approved,"Classname2",Classname3))You can write specific style color to required classnames(Classname1,Classname2,Classname3 )Regardsrajesh
Hi @Priya Mv ,
I have attached the sample oap demo file for you. It is aligned to your design.
I have used MaxStock column for condition, you can use any column attribute to apply condition.
Also, you can add more css class for each status and different colors.
I have used only good or bad as example.
Check the below screenshots for reference and where you need to make change, please move the Css page to your application theme.
I hope this helps.
Regards,
Manish Jawla
I am getting color in screen but when I publish its not executing .I will attach the condition I wrote. Can someone help how to get the required output.
Hi Priya,
check the last one, "status-Rejected" but you have mentioned "status-rejected"
Can you change that and try.
If you have only 3 status, and the record will be in either one of these 3 status. you can change the condition too.
if(GetReqLists.list.currect.reqList.status="Approved", "status-Approved",
if(GetReqLists.list.currect.reqList.status="In progress","status-Inprogress","status-Rejected"))
Can you share your sample oml?
because it should work as expected according to the .oap app I have shared with you.
Have you added these css on the same screen or module?
Please clear the cache of your browser and try again or try in Incognito mode.
I made changes as you said even now when I publish it's not displaying on the browser.
That's why I am requesting you to share a sample oml with your example code, so that we can analyse it and share the fix with you because according to our sample code it should work as expected.
Manish Jawla.
Sorry for the late response. I am attaching my sample OML for your reference below.