She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

how can i change the text color

Hi Team,

I need help. i want to change the text color:

For example i want to change the text color if the response is "MO" the color of the text will become "RED". and if "TC" it will remain as "BLACK" please see the screenshot below:

Image

Code: Select all

 
 Inside the JS in Type.text 
 if(Apperyio("type").text("MO")){ 
  Apperyio("time").css('color','#ff0000'); 
 }  

output is:
Image

i hope you can help me here.

Regards,

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

how can i change the text color

Hello,

Please use JS code below for that:
preif(value === "MO"){
element.css('color','#ff0000');
} /pre

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

how can i change the text color

this is the element of the time?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

how can i change the text color

Hello She,

Please try changing your code with the code provided by Sergiy.

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

how can i change the text color

Yes i already tried it please see screenshot below:

Image

the color red must the time if the text is MO.

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

how can i change the text color

and i tried the following code

if(value.Type === "MO"){
element.css('color','#ff0000');
}

still no luck,

thank you

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

how can i change the text color

If you need to change the color of the time element - plese remove JS from the mapping to the label "Type" and add JS to the listitem component:

preif(value.Type === "MO"){
element.find("name=time").css('color','#ff0000');
} /pre

Image

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

how can i change the text color

Hi Sergiy,

I already tried this but there's an error showing please see screenshots below:

Image

Image

Thank you for helping,

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

how can i change the text color

Hi Sergiy,

Thank you for helping me, i already figured it out:
just incase someone needed this please see the code below. i've just change something

code
if(value.LogType === "MO"){
element.find("[name='time']").css('color','#ff0000');
}
/code

Best Regards,

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

how can i change the text color

Hello She,

Thank you for the update and sharing!

Return to “Issues”