Page 1 of 3

Styling customization questions

Posted: Thu Mar 26, 2015 11:12 pm
by Ellen Schlechter
  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?

Styling customization questions

Posted: Fri Mar 27, 2015 9:51 pm
by Egor Kotov6832188

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...


Styling customization questions

Posted: Sat Mar 28, 2015 2:11 am
by Ellen Schlechter
  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.


Styling customization questions

Posted: Sat Mar 28, 2015 2:15 am
by Ellen Schlechter

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

Also tried

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

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

</body>
</html>/code


Styling customization questions

Posted: Mon Mar 30, 2015 10:01 pm
by Ellen Schlechter

Does anyone have any advise here?


Styling customization questions

Posted: Wed Apr 01, 2015 7:42 am
by Egor Kotov6832188

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.


Styling customization questions

Posted: Wed Apr 01, 2015 4:39 pm
by Ellen Schlechter

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


Styling customization questions

Posted: Wed Apr 01, 2015 10:17 pm
by Ellen Schlechter

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.


Styling customization questions

Posted: Thu Apr 02, 2015 6:31 am
by Egor Kotov6832188

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;


Styling customization questions

Posted: Thu Apr 02, 2015 12:19 pm
by Ellen Schlechter

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