Carlos Salim
Posts: 0
Joined: Sun Jun 08, 2014 11:38 pm

Dynamically change ListItem background color based on Label.text

I am having the same problem. I can change the color of an entire grid, but I can do it to a single cell.

NOT WORK: Appery('mobilegridcell_XX').css('background-color', '#00f0ff');
WORK: Appery('mobilegrid_XX').css('background', '#000000');

Any reason for that?

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

Dynamically change ListItem background color based on Label.text

Hello Carlos,

Please try this code:

code$("[name=mobilegridcell_XX]").css("background-color","red"); /code

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Dynamically change ListItem background color based on Label.text

Hello Everyone,

thks for the update, I like very much the icons :)

in the itemlist, before when inserting labels, the itemlist's background turned to white.

now it remains of color, we can neither change the swatch not call a class for css, ...
I tried the "more properties" attribute but unsuccessful, ... even the above code element.parents("li").css("background", "red");
in the JS nxt to mapping component.

any idea how to make it white this itemlist's background ? :)

thk you,
Eric

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

Dynamically change ListItem background color based on Label.text

If you want to dynamically change the color of list item with elements inside, you should try this code on click on list item.
pre$(this).find(".ui-li-static-container").css("background-color", "red");/pre

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Dynamically change ListItem background color based on Label.text

Hi (again) Evgene, thks for your prompt fdbk.
I'll try this.
Best,
Eric

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Dynamically change ListItem background color based on Label.text

this work good for a onclick.

however, maybe my mistake in not explaining clearly enough, what I need is same as before this weekend update: when placing a label into the itemList, the itemList turned to white background.

my question: how to make the itemList with white background onload either with the screen (page) panel JS, or with the mapping component JS ?

thk you in advance,
Eric

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Dynamically change ListItem background color based on Label.text

Hi Eric,

You can add this code to mapping. But if you want to change background colour for all such elements, I would recommend that you run the following code on service Complete event:pre$(".ui-li-static-container").css("background-color", "red");/pre

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Dynamically change ListItem background color based on Label.text

Hi Katya,
it works well.
thk you for your time,
Eric

Return to “Issues”