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

Styling customization questions

  1. If a database boolean is true, how can I change the text color of a listed label? A have a list that is populated with the database and if a certain column's call is true, I want the text in the list to be red.
    1. I have a check box but I want it smaller than the mini version. I can adjust the width with a grid but how can I adjust the height?
Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

Styling customization questions

Hello Ellen,

#1

To implement this feature you need to add js code during mapping for you listitem
inside it you can use element variable which refers to html tag
http://gyazo.com/e966cb382e8893db01c2...
http://gyazo.com/53d852dbe67a097aef73...

#2
a) You need to find your element on the page
b) think about best css selector, which will be applied
c) write this selector at CSS file in you Appery.io project

you can you as example next tutorial
http://blog.bismallion.com/appery-tut...

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

Styling customization questions

  1. I tried putting this code in place but there are errors with it. Also can I use it will an if else statement?

    This text will be red.

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

Styling customization questions

codecolor="red"></font>/code

Also tried

code<!DOCTYPE html>
<html>
<body>

<p><color="red"></font></p>

</body>
</html>/code

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

Styling customization questions

Does anyone have any advise here?

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

Styling customization questions

Ellen,

About DOCTYPE and other html - it's redundant and invalid.

code<p><color="red"></font></p>/code - this is also wrong, cause
1) you are missing opening font tag
2) code<color="red">/code this is not an html, and with wrong styling

you have two ways to make this work:
1) change color during mapping:
a) open success mapping
b) add js (by clicking on green js button )for label you wish color to change
c) add:
if (value) {
$(element).css({'color':"#900"});
}

2) change color after mapping was complited:
a) add js code after mapping event for your service
b) in code you need to write jquery selector which finds all labels and changes color.

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

Styling customization questions

So I am using this code:

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

It works if I use the first option and change it during mapping but I realized that the mapping is what populates the label that it reads so I tried running the JS on the success of the mapping and on the completion of the service but neither works.

I then tried changing the code to this and adding it in various places but it didn't work either.

if (mobilelabel_595===true) {
$appery(mobilelabel_588name).css({'color':"#900"});
}

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

Styling customization questions

So what I am doing right now...I have the mapping that maps the label that stores the information to determine the color. On that success, I invoke the service that populates the label that I want to change color. There I have this code but I get an error saying that it can't find the variable mobile label_595. I can't store anything in local storage because I need it to be specific to each list item.

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

So, my main question is how can I retrieve a value from a label? Obviously I'm doing it wrong by just having (mobilelabel_595===true) and I need something else in there.

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

Styling customization questions

Ellen,

obviously I'm doing it wrong by just having (mobilelabel_595===true)

Yes, you are trying to use undefined variable mobilelabel_595 and compare it value to Boolean value true, cause such mobilelabel_595 variable doesn't exist, you will always have false as result of next expression (mobilelabel_595===true)

Please follow, provided steps, it is correct for your case;

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

Styling customization questions

I did try to follow the steps you gave a few days ago and I understood the first set so that is what I tried to do. I think the second would work better but I don't know how to find the label an get its value. I did some researching on the internet and tried this but it didn't work either. The text in the label will say true if the color should be changed.

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

Return to “Issues”