Basic question please, I have an IG.
Trying to format a column using the following:
SELECT
CASE
WHEN my_number <= 3 THEN 'u-color-7-bg'
WHEN my_number > 3 THEN 'u-color-8-bg'
END some_color
FROM my_table
I'm modifying the resulting column 'some_color' to be an HTML Expression type.
On its HTML Expression part I have:
< span style="color: &SOME_COLOR.">&MY_NUMBER.< /span>
But it doesn't work, no format is getting applied whatsoever.
Can anybody give me a hand please?
u-color-xx are CSS classes not actual colors. It should work if you try <span class="&SOME_COLOR.">&MY_NUMBER.</span> instead.
Alternatively you can use CSS-Variables defined by APEX in newer versions like this: <span style="background: var(--u-color-35)">&MY_NUMBER.</span>
https://codesandbox.io/s/m3ljr4zl8p
example.js
I wasn't expecting column1 data to start overlapping into column2's instead of going down as it is now exceeding the grid column width.
What is the solution for this?
Columns are not overlapping. It's your <p> element takes more space than columns.
Add this style to it:
word-break: break-word;
Before word-break:
After word-break:
I created a gmail account and then when to Google+. On landing page, it first asked me to complete profile like Gender / Month / Date
I observed that there is no Select Tag. It is a dynamic div and it uses active-
<div class="mxa MC">
<div aria-activedescendant=":1x" aria-haspopup="true" tabindex="0" aria-expanded="false" style="-moz-user-select: none;" role="listbox" class="d-k-l d-y-r-c b-Qb hl">
<div aria-posinset="0" aria-setsize="4" role="option" id=":1x" class="d-k-l d-y-r-c-ha">Select</div>
<div aria-hidden="true" class="d-k-l d-y-r-c-Qa"> </div>
</div>
</div>
Am not able to understand how to click Male / Female once the dropdown list opens. The html doesn't change only the class expands further and aria-activedescendant value changes to :1q in case Male, :1r in case mouse hovers or Female
And on choosing this attribute value is set and next line "Select" text is changed to Male or Female, whichever chosen.
So how do select Gender or list items in such a situation
Flow was:
I created new Google Play Account through BlueStack, where it didn't ask for Gender / Month / Date
Then I opened browser on Desktop and opened this link
https://plus.google.com/up/accounts/upgrade/?continue=https://plus.google.com/
And there you get the option of Gender / Month / Date
I have a layout with an image to the left and a text on the right for medium and large views. I want to the text to be BEFORE the image on "small-12" though.
The pull/push mechanism does not seem to work with "xxx-12" columns.
These are my divs:
<div class="large-4 medium-6 small-12">Image</div>
<div class="large-8 medium-6 small-12">Text</div>
Here you go. You are missing columns. You want to order the small content first. Then push pull http://cdpn.io/xfJph
I'm currently struggling to find anyone who knows how this can be done? I've tried a few different methods and ended up with halfway results but not quite what i wanted. Basically i'm trying to create a list showing all the bands A-Z, but the band names are being called from a database, so i'm having to use #band_name# within a nested list. If i re-write the code and post it, someone might be able to see where i'm going wrong.
<cfoutput query="bandNameList">
<cfloop from="65" to="90" index="i">
<UL>
<LI> #chr(i)#
<UL>
<LI> #band_name# </LI>
</UL>
</LI>
</UL>
</cfloop>
</cfoutput>
What I think you're after is to only output the Letter for the first band that begins with that letter.
One way to achieve this is to change your query slightly (note I'm using what I think is SQL-92 syntax here, but there's probably a nicer way to get the first letter in your particular database):
select
band_name,
SUBSTRING(band_name from 1 for 1) AS first_letter
from
bands
order by
band_name
Which will get you the first letter in the query.
If you want to group all the bands with numeric first letters together, then you can use SQL's CASE statement to do that (you may need to find the equivalent to ascii() in your DBMS). You could also invert the logic and match against 'normal' letters and lump everything else into a '0-9 and punctuation' category if that's easier. I think that's what a number of music systems do (I'm thinking iTunes on the iPhone, but I'm sure there are others)
select
band_name,
CASE
WHEN ascii(left(band_name, 1)) BETWEEN 48 AND 57 THEN '0-9'
ELSE left(band_name, 1)
END AS first_letter
from
bands
order by
band_name
Now you can use that extra column along with cfoutput's group attribute to help get the output as you want it.
<UL>
<cfoutput query="bandNameList" group="first_letter">
<LI> #first_letter#
<UL>
<cfoutput>
<LI> #band_name# </LI>
</cfoutput>
</UL>
</LI>
</cfoutput>
</UL>
Update your query to have a left(band_name,1) AS BandStart and make sure to order by band_name in your ORDER BY. Then use group to output the list.
<cfoutput query="bandNameList" group="BandStart">
<UL>
<LI>#bandNameList.BandStart#
<cfoutput>
<UL>
<LI> #bandNameList.band_name# </LI>
</UL>
</cfoutput>
</LI>
</UL>
</cfoutput>
If you want to display all letters, even if no bands starting with that letter exist, another option is using a CTE to generate a table of letters A-Z. Then display the results with a "grouped" cfoutput:
<cfquery name="getBandNameList" ...>
;WITH ltrs ( code ) AS (
SELECT ascii('A') AS code
UNION ALL
SELECT code + 1
FROM ltrs
WHERE ascii('Z') > code
)
SELECT char(code) AS letter, t.band_name
FROM ltrs LEFT JOIN #YourTable t ON t.band_name LIKE char(code) +'%'
ORDER BY letter ASC, t.band_name ASC
</cfquery>
<cfoutput query="bandNameList" group="Letter">
<UL>
<LI> #letter#
<UL>
<cfoutput>
<LI> #band_name# </LI>
</cfoutput>
</UL>
</LI>
</UL>
</cfoutput>
Another approach is to write a sql server stored proc that returns everything in a single query object. The code would resemble this:
declare #thisNum as int
declare #lastNum as int
set #thisNum = 65;
set #lastNum = 90;
declare #letters as table(letter char(1))
while (#thisNum <= #lastNum)
begin
insert into #letters values (CHAR(#thisNum))
set #thisNum = #thisNum + 1;
end
select letter, bandname
from #letters left join band on letter = left(bandname, 1)
order by letter, bandname
Then, in ColdFusion, you can use cfoutput with the group attribute.
Try this code ::
<cfquery datasource="orcl" name="list">
select upper(brand) brand from tbl
</cfquery>
<cfoutput query="list">
<cfloop from="65" to="90" index="i">
<UL>
<LI> #chr(i)#
<UL>
<LI><cfif mid(brand,1,1) eq chr(i)> #brand#</cfif></LI>
</UL>
</LI>
</UL>
</cfloop>
</cfoutput>