Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Hi There #1
If something EQ to value then apply a style
There is probably a simple solution to this, but after much searching I haven't
found much info...
I have a table with rows where values can be either 'Goal' or a 'Strategy'.
If the record returned is 'Goal', then I want to apply a bold style to those
rows. Is this possible? Something similar to the following (I know my syntax
is wrong):
<cfset strong_css_class = If (GOAL_STRATEGY EQ Goal, styleclass="bold")>
<td
class="#strong_css_class#">#DivisionsGoalsStrategi es.GOAL_STRATEGY#</td>
<td>#DivisionsGoalsStrategies.GOAL_TEXT#</td>
<td>#DivisionsGoalsStrategies.GOAL_IDENTIFIER#</td>
<td>#DivisionsGoalsStrategies.GOAL_CREATE_BY#</td>
Basically my question is if you can apply a CSS style dynamically to a column
or row if a certain condition is met... and how I would go about doing that.
Thanks.
Hi There Guest
-
Can I apply Optical Margin Allignment through a Paragraph Style?
I can't find a way to make Optical Margin Alignment part of a certain paragraph-style. I'm now clicking a text frame from any story to apply it. ... -
How do I apply a keyboard shortcut to None character style
I have looked everywhere that I can think of, but can't figure out how I can apply a keyboard shortcut to the 'None' character style; can it be done?... -
Apply css style to table cell?
Is there a way to apply a css style to a table cell? I have a style that creates a dotted line on the top border and needs to be applied to a cell... -
Need help with Style conversion from Style object to Style key/value collection.
I am writing a custom control that derives from the DataGrid control. I would like to apply SelectedItemStyles and ItemStyles for use in my derived... -
Number format German style => English style when importing CSV files into MySQL-DB
Hi there, I'm trying to import a csv file into my MySQL database. Unfortunately the number format for the price column is formatted in German... -
Stressed_Simon #2
Re: If something EQ to value then apply a style
You have answered your own question????
Stressed_Simon Guest
-
Hi There #3
Re: If something EQ to value then apply a style
How simple. That worked!
I'm relatively new to CF, so sometimes I think things are going to be more
complicated than they need to be...
Thanks.
---------
I also got my origianal idea to work too, but with some changes in the syntax:
<CFSET strong_css_class = IIF(DivisionsGoals.GOAL_SIMPLE_TYPE EQ 'Goal',
"'Style1'", "'Style2'")>
<td class="#strong_css_class#">#DivisionsGoalsStrategi es.GOAL_STRATEGY#</td>
<td>#DivisionsGoalsStrategies.GOAL_TEXT#</td>
<td>#DivisionsGoalsStrategies.GOAL_IDENTIFIER#</td>
<td>#DivisionsGoalsStrategies.GOAL_CREATE_BY#</td>
This applies Style1 from my linked css to the cell if the returned value is
'Goal', and applies Style2 if the value is not = 'Goal'.
Hi There Guest



Reply With Quote

