Page 2 of 3

Dynamically change ListItem background color based on Label.text

Posted: Tue Jul 02, 2013 12:28 pm
by Maryna Brodina

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


Dynamically change ListItem background color based on Label.text

Posted: Tue Jul 02, 2013 12:30 pm
by Roger

That is it!!!

THANK YOU!!


Dynamically change ListItem background color based on Label.text

Posted: Thu Jul 11, 2013 3:32 pm
by Roger

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');
}


Dynamically change ListItem background color based on Label.text

Posted: Thu Jul 11, 2013 4:05 pm
by Maryna Brodina

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


Dynamically change ListItem background color based on Label.text

Posted: Thu Jul 11, 2013 4:09 pm
by Roger

It works!!! Thanks.


Dynamically change ListItem background color based on Label.text

Posted: Sat Jan 04, 2014 10:12 pm
by bahar.wadia

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 ?


Dynamically change ListItem background color based on Label.text

Posted: Sat Jan 04, 2014 10:34 pm
by Alena Prykhodko

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


Dynamically change ListItem background color based on Label.text

Posted: Sun Jan 05, 2014 2:25 am
by bahar.wadia

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


Dynamically change ListItem background color based on Label.text

Posted: Sun Jan 05, 2014 3:59 am
by bahar.wadia

I found this works....

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

Where "GUI_Test" is my page name.


Dynamically change ListItem background color based on Label.text

Posted: Sun Jan 05, 2014 4:31 am
by Alena Prykhodko

Thanks for update. Is this question related https://getsatisfaction.com/apperyio/... ?