Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Dynamically change ListItem background color based on Label.text

Hello! In mapping to the function also passes element (besides the value). Please try the folowing code:
codeelement.parents("li").css("background", "red");/code

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Dynamically change ListItem background color based on Label.text

That is it!!!

THANK YOU!!

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Dynamically change ListItem background color based on Label.text

Marina,

I have this working with background of the ListItem. I am now trying to change the font color of a Label. I have a ListItem and in the ListItem there is a grid with 2 columns. In each column there is 1 label and I would like to change the font color of the label to white. How do I get a reference of that label.

I have the following code but the font color changes for all labels.

if (value == true) {
var listItem = element.parents("li");
listItem.css("background-color", "red");
$('div[dsid="CashierTotals_Descrpt"]').css('color','white');
}

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Dynamically change ListItem background color based on Label.text

Hello! Try with the following code:
codelistItem.find('div').css('color','white');/code

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Dynamically change ListItem background color based on Label.text

It works!!! Thanks.

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

Dynamically change ListItem background color based on Label.text

I am trying to change the background color of a cell in a grid. I tried...

Appery("mobilegridcell_128").css("background-color", "blue");

but it does not work. What am I missing ?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Dynamically change ListItem background color based on Label.text

Hello!

This can be done easier. Please excel grid cell you want to style, then in Properties untick Background Transparent and set Background Color.

Image

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

Dynamically change ListItem background color based on Label.text

Yes, that is correct, but how can I do it with javascript at runtime ?

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

Dynamically change ListItem background color based on Label.text

I found this works....

document.getElementById('GUI_Test_mobilegridcell_3').style.backgroundColor = 'transparent';

Where "GUI_Test" is my page name.

Return to “Issues”