Hi Matts,
I would suggest the following:
<cfloop query="rs_resource">
<cfif rs_resource.create_d NEQ "">
<cfset this_date_diff = dateDiff("M",now(),rs_resource.create_d)>
<cfif this_date_diff GTE -3>
<cfset really_new_title = "<span style='font-weight:bold;
color:##CA6526;'>NEW</span> "&rs_resource.title>
<cfset temp =
QuerySetCell(rs_resource,"title","#new_title#",rs_resource.CURRENTROW)>
</cfif>
</cfif>
</cfloop>
This will work in cfgrid, you will get your results displayed in cfgrid with
the HTML code to support a bolded, coloured "NEW".
> Hi Everyone,
>
> I have a great ajax/cfgrid mockup working. Sorting, filtering etc..
> all working very well. Client has just asked if I can extend it a
> little more.
>
> Gridrow 1 = "Title"
> they would like the words "NEW" to be prefixed to the title (and stand
> out in a bold, coloured font) if the item has a create date that is 3
> months from today.
>
> I need to do this either at the SQL select or after if I re-parse the
> recordset and change the field "Title" to include this information.
> Creating another column in the cfgrid is not an option.
>
> So my quesiton.
>
> 1. Is this possible in SQL? (using if/then and insert (not insert into
> table, but insert something into a Select returned field)
> statements??)
>
> I'd need someting like
> IF create_d between <3 months ago> and <now>
> Then
> INSERT(title,0,0,'<span
> style="font-style:bold;color:#000000;">NEW</span>') AS new_title
>
> (the insert syntax is: (field, location, replace x chars, replaced
> text)
>
> OR
>
> 2. Can I parse through a recordset in CF 8 (in a CFC) add this where
> needed and still return a query that the grid is bound to? Anyone have
> a code sample that does this?
>
> Many thanks,
>
> Matts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305333
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4