ColdFusion Muse

Adding an image to a CFGRID

Silly me, I assumeed you couldn't insert images into a flash CFGRID. I stumbed across this example on an excellent blog by As Fusion (laura Arguello and Nahuel Foronda). Apparently you can insert thumbnails right into the grid using an HTML element. That's a new one on me. The trick is to bind a column in the grid to a CfFormItem. As always, someone will always find a way.

<cfform name="myform" format="Flash" height="450" width="600" >
<cfgrid name= "grid" query="properties" height="200">
<cfgridcolumn name="city" header="City">
<cfgridcolumn name="photo" header="Photo">
</cfgrid>
<!--- show the picture in an html cfforitem
paragraph is added because Firefox sometimes fail to load the picture --->

<cfformitem type="html" height="200" width="300"
bind="{'<p><img src=\'images/'+grid.selectedItem.photo+ '\'></p>'}"
></cfformitem>
</cfform>

  • Share:

1 Comments

  • Dave Miller's Gravatar
    Posted By
    Dave Miller | 1/12/06 9:58 AM
    What are you using to add code blocks with colors to your blog posts? Are you performing the highlighting manually?