Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

cfgrid-show image

Posted on 2010-09-16
5
Medium Priority
?
682 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 2000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

604 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