Eg If the value is 0, change text to red.
If it is 1, change text to green
How can I make this appear in the items in a table?
If it is 1, change text to green
How can I make this appear in the items in a table?
Use a switch
I tried but I could not
In column view (as an example)
Data source: {var:tablename.row.model.otherfield}
Body:
0:red
1:green
columnname:<span color="{fn:colorswitch}">{var:tablename.row.model.field}</span>In switch
Data source: {var:tablename.row.model.otherfield}
Body:
0:red
1:green
Thanks for the answer.
But another question arose.
How can I use the switch to check if there is something written in the database table and get a return?
Ex.
Optional upload of files.
Check if there is any data written in the table and show the link to view the file, if not leave it blank.
Sorry my english hehe
But another question arose.
How can I use the switch to check if there is something written in the database table and get a return?
Ex.
Optional upload of files.
Check if there is any data written in the table and show the link to view the file, if not leave it blank.
Sorry my english hehe
{var.empty: Will be either true or false
Sorry, but I did not understand how to use it
Please detail
Please detail
{var.empty:variable_name} as the data source in a switch
thanks!
Good Morning
One more question regarding the switch in CF.
Database Ex:
db_brand: Ford, Chevrolet
db_cars: Mustang, Fusion, Camaro, Equinox ...
I have two dropdowns, in the first db_brand load, this relates to the second dropdown that loads db_cars.
Everything is working perfectly, to load the second dropdown I do a reload.
My problem is when I use the new function, Allow Additions.
When I type a new car for example, when reloading, the second dropdown goes blank, I would like it to be reloaded along a default value.
How can I do this?
One more question regarding the switch in CF.
Database Ex:
db_brand: Ford, Chevrolet
db_cars: Mustang, Fusion, Camaro, Equinox ...
I have two dropdowns, in the first db_brand load, this relates to the second dropdown that loads db_cars.
Everything is working perfectly, to load the second dropdown I do a reload.
My problem is when I use the new function, Allow Additions.
When I type a new car for example, when reloading, the second dropdown goes blank, I would like it to be reloaded along a default value.
How can I do this?
You can use a * as a wildcard in your switch if you have the latest version
OR you can just use a default in your dropdown. It should look something like this
{var:mybuiltdropdownlist/apples=Apples are my favourite fruit}
This way if the mybuiltdropdownlist is empty, then a value of "apples" with the label "Apples are my favourite fruit" will be supplied instead.
OR you can just use a default in your dropdown. It should look something like this
{var:mybuiltdropdownlist/apples=Apples are my favourite fruit}
This way if the mybuiltdropdownlist is empty, then a value of "apples" with the label "Apples are my favourite fruit" will be supplied instead.
How do I *
The other option, when reloading the second dropdown, disappears
The other option, when reloading the second dropdown, disappears
*sigh*
You know how in a switch you have say
1:Something you want shown if it's 1
0:Something you want shown if it's 0
?
*:Something you want shown if it's anything else
Just make sure that * comes last.
You know how in a switch you have say
1:Something you want shown if it's 1
0:Something you want shown if it's 0
?
*:Something you want shown if it's anything else
Just make sure that * comes last.
It worked, but ...
Note: I left as follows
{var: read_data25}
* Apple = Apple
However, if I decide to choose again from the list that I already have in the database (1st dropdown) when reloading the 2nd dropdown, it has the "Apple" option and below the list the reloaded item
1st image - shows when a new item is added (typed).
2nd image - shows when I decide to choose one of the items loaded in the database. In this case, the 2nd drop-down is reloaded and with two options, the second of the list is the option that should be chosen.

Note: I left as follows
{var: read_data25}
* Apple = Apple
However, if I decide to choose again from the list that I already have in the database (1st dropdown) when reloading the 2nd dropdown, it has the "Apple" option and below the list the reloaded item
1st image - shows when a new item is added (typed).
2nd image - shows when I decide to choose one of the items loaded in the database. In this case, the 2nd drop-down is reloaded and with two options, the second of the list is the option that should be chosen.


Solved the problem

that way the correct item is now in 1st in the list

that way the correct item is now in 1st in the list
{var: read_data25}That's not at all what I told you to do.
* Apple = Apple
{var:read_data25} would go in the dropdown options list, the *:Apple=Apple would go in the switch.
Even though it works that way, but whenever reload is given it returns two values,
This topic is locked and no more replies can be posted.