Solved

cfgrid-show image

Posted on 2010-09-16
5
673 Views
Last Modified: 2012-05-10
Hello experts.
i need help to show images in a cfrid,instead of the name of the image(img_text) in the following example:
<cfgrid name="All_imagesgrid" format="html" pagesize="30" insert = "Yes"   sort="yes" width="100%"
    rowheaderbold="yes" colHeaderBold = "Yes"    pictureBar="yes" hspace="0" vspace="0"  bind="cfc:cfc.All_images.getAll_images({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{filtercolumn},{filter})"  selectmode="single">
      <cfgridcolumn name="artimages_ID" header="artimages_ID"  select="no" display="false"/>
      <cfgridcolumn name="img_id" header="img_id" width="30" numberformat="9" select="no" display="false"/>
      <cfgridcolumn name="img_text" header="img_text" />
     
   </cfgrid>

Any help?
0
Comment
Question by:Panos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:reiters
ID: 33691936
I have created a query recordset manually and pushed all the query results into it but also added html to a column of my creation.  In my case I wanted some links.  It worked but was very slow.  You might find that using jQuery grid.  It can give a little more control if you have any experience with javascript.

The typed code may have some mistakes as I typed it without testing, but should give the idea.
<cfquery name='foo'>
  ....
</cfquery>
<cfset bar = querynew('one,two,html_img')>
<cfloop query='foo'>
   <cfset queryaddrow(bar)>
   <cfset querysetcell(bar,'one',foo.one)>
   <cfset querysetcell(bar,'two',foo.two)>
   <cfset querysetcell(bar,'html_img','<img src="#foo.img_name#">')>
</cfloop>

Open in new window

0
 
LVL 2

Author Comment

by:Panos
ID: 33700239
Hi reiters.
Thank you for your help.As i see it will be very complicated for me.Using my code i have a grid where i can add,delete,alter,sort all the data.
So i will have to change all these with jquery (i use jquery but for othr functions and using tutorials without javascript experience) and i don't know if i can do it.
A better idea is to use a second grid with flash format to show only the images.
I hope i will get another solution,otherwise i will close the question.
0
 
LVL 2

Author Comment

by:Panos
ID: 33700280
Another idea.
Can i use jacascript and cfwindow and when i click on the row with img_text (<cfgridcolumn name="img_text" header="img_text" />) to show the image in the cfwindow.(or jquery)
0
 
LVL 6

Accepted Solution

by:
reiters earned 500 total points
ID: 33701359
jQuery is easier in my opinion because it doesn't play games with your java script.  It can be done in either.  What I'm suggesting is this.

1.  Query the data you want
2. create a new blank query recordset <cfset foo = querynew('column1, column2..., new_img_column')
3. loop over the real query's records transferring the info to the other one AND stuffing the html for the image in the new_img_column. (make sure to keep your quote marks in line)
4. send your new homemade query to the html grid.

It's ugly but works.  I used it to add an "option" grid column that contained links to edit/delete the data in that row.

You could put <a href='javascript: void(0);' onclick='pop_window(db_key);'>#img_name#</a> in the fake column discussed above.

You would need a JS function pop_window in the appropriate place on the page.
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 33701510
Thank you.
if i will have problems i will come back
regards
panos
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question