Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

Styling customization questions

Ellen,

In mapping on success event for your service,
for your label add js, by clicking on green JS button, then place my code there, and that is all

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Styling customization questions

I only need the label to be red if another label associated with it is has the text 'true'. I understand that having $(element).css({'color':"#900"}); will make the label red no matter what but I need to have only if mobilelabel_595 is true. It is mapped to be true in the same service that lists the label. So I need the label that needs a color change after the regular list is listed so it can read it.

I keep getting an error saying that mobilelabel_595 is not a defined variable.

I've tried this these two things but neither worked. How can I retrieve the value from a label?

if ($(mobilelabel_596).text()===true) {
$(element).css({'color':"#900"});
}

var color = ($(mobilelabel_596).text());
if (color===true) {
$(element).css({'color':"#900"});
}

My app is shared with support and called The Calving Book. The service I am working with is on screen1 and is called book_filter. The mapping to mobilelabel_588name is where the JS needs to be applied.

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Styling customization questions

Still struggling with this. I found that this code doesn't produce any errors.

var color = ($('#mobilelabel_596').text());
if (color===true) {
$(element).css({'color':"#900"});
}

I still don't know how to list it though. Could I run this JS upon list service success and where it says element, have it be the label that I want changed?

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Styling customization questions

Again, it is shared with support.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Styling customization questions

Hi Ellen -

What label returns if you have a value inside it? You can check this with typeof operator in the browser console and see if you're writing correctly your 'if..else' statement.

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Styling customization questions

The label that stores the value that determines whether the color is change is mobilelabel_596.

The label that needs changing is mobilelabel_588name.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Styling customization questions

Have you tried to use typeof with mobilelabel_596, what it returns?

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Styling customization questions

I tried typing in the console-- typeof mobilelabel_596 and it returned "undefined". Some of the labels will say undefined and that is fine but if they says true, mobile label_588name needs to be red.

Here is the public link:
http://appery.io/app/mobile-frame?src...

If you log in with username: jane and password: 123 , select a value in the select book menu in the header. There you will see items listed. There is a label at the bottom of each list item. Some will say undefined and some will say true.

The app is also shared with support.

Return to “Issues”