Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6133577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:14:50+00:00 2026-05-23T17:14:50+00:00

Using CF9 and have a pretty basic html cfgrid that returns results from a

  • 0

Using CF9 and have a pretty basic html cfgrid that returns results from a SQL query.

There are just two columns in the grid: “ID” and “IDType”.

I’m looking to see if there’s a way to implement some logic so that when I certain IDType shows up, the value in the ID field becomes the key value in a hyperlink.

Example: IF IDType = “web”, and the ID is “1234”, the value inside the ID field would show up as http:/www.website.com/1234.html (or…better: just show up as “1234” but be hyperlink-enabled to go to the aforementioned site.)

If the IDType is not (for example) “web”, then the value just shows up as a regular cell value (text).

                   <cfgrid
                        name="idGrid"
                        title="Related IDs"
                        query="get_IDs"
                        format="html"
                    >
                        <cfgridcolumn name="ID" header="ID" />
                        <cfgridcolumn name="IDType" header="ID Source" />

                    </cfgrid>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:14:51+00:00Added an answer on May 23, 2026 at 5:14 pm

    One way to do this is you can generate and append a column to your query using the queryColumnAdd() function, put your link in the cell, and then push the modified query it to the cfgrid.

    The link will render and you can click on it!

    If I may pseudo code.. first write your normal query

    <cfquery name = "myQuery"  datasource = "myCFDatasource">
       SELECT ID, field1, field2, field3
       FROM aTable
    </cfquery>
    

    Next, we add your link column onto it..

    <cfset queryAddColumn(myQuery, "Link", ArrayNew(1)) />
    
    <cfloop query="myQuery">
        <cfset querySetCell(myQuery, "Link", "http://www.mysite.com/some/index.cfm?ID=#myQuery.ID#"), myQuery.currentRow) />
    </cfloop>
    

    Then, you can take your modified query myQuery and submit it into your cfgrid like you did above.

    Hope that helps get you on the right path.., worked well for me the last time I used it!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm exporting data using CF9's cfspreeadsheet tags and functions, some columns have HTML formatted
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using a Microsoft version of SQL, here's my simple query. If I query a
I have a binary file that I've disassembled using avr-objcopy. The interrupt vector table
Using CRM 4, I have an entity form that contains a tab with an
using ASP.NET MVC, I have a Model, to which I'm attaching attributes so that
Using codeigniters mvc, I have created a model for my search query and I
I'm used to setting up CF9 (Dev edition) on my Windows machine, using Apache.
Using online interfaces to a version control system is a nice way to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.