Zach asks, "Is there a way to bind an image to a column in a Flash Grid?" The answer is yes. From the docs for cfgridcolumn, we see that the type attribute for cfgridcolumn allows for "image" as a value. Some notes though:
- If you use a relative path, i.e., "images/jedi.jpg", CF will assume the image lies under CFIDE/classes. Read on for a way to handle that.
- If the image is too big to fit in the column cell, it will be clipped.
- The image must be a JPEG file.
So, if you are like me, you don't normally store the full path to an image in the database. This means you will have relative image paths in your data and the gridcolumn won't display right. There are a few ways you can fix that. You can actually write your sql so that it returns the data with the proper path. As an example:
select name, '<img src="/images/"' & img & '>' as imagepath
from foo
(Note - I always forget the proper character to join strings in SQL - it may be + instead of &, but you get the idea.)
You could also use QueryOfQuery to modify the query to contain the full path. You get the idea.
Archived Comments
Okay, I've done that... but now I'm having a weird rendering issue with the images. I've got the page dynamically creating a query that has the image paths in it, and it's loading the images, but after they all load, they disappear until you scroll the grid. Any thoughts on why this would be happening?
Got an online example?
A lot of people have experienced the "dissapearing" image in the grid problem. It mostly happens with Firefox. You can see an online example at
http://www.asfusion.com/blo...
Ray, e-mail me off list, and I'll send you a link and login information.
Okay jedi, how about a slightly harder question. Can I embed a pdf inside a flashform? using something similar to the way I embed a pdf in an html page:
<OBJECT ID="PDF" CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH="800" HEIGHT="450">
<PARAM NAME="SRC" VALUE="/testing/testpdf.pdf">
<OBJECT>
I have tried wraping it in a <cfformitem type="html"> but it doesnt seem to work. It doesnt throw an error, just nothing shows up. Any ideas?