coldfusioncoldfusion-8cfgrid

CFGRID With a Link


I am working with ColdFusion Version 8. I have a CFGrid displaying some data:

<cfgrid name="GVDisplayUsers" format="html" height="500" autowidth="true" width="950" font="Tahoma" fontsize="12" sort=yes bind="cfc:CFFunctions.getUsers({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">

<cfgridcolumn name="ID"  header="ID">
<cfgridcolumn name="USERID" header="USERID">
<cfgridcolumn name="FIRST_NAME" header="First Name">
<cfgridcolumn name="LAST_NAME" header="Last Name">

</cfgrid>

What I wanted to do is have the ID column be a link to the USER information page.

How do I go about doing this?

Thanks,


Solution

  • <cfgridcolumn> has href and hrefkey attributes

    <cfgrid name="GVDisplayUsers" format="html" height="500" autowidth="true" width="950" font="Tahoma" fontsize="12" sort=yes bind="cfc:CFFunctions.getUsers({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
    
     <cfgridcolumn name="ID"  header="ID" href="userpage.cfm" hrefkey="USERID">
     <cfgridcolumn name="USERID" header="USERID">
     <cfgridcolumn name="FIRST_NAME" header="First Name">
     <cfgridcolumn name="LAST_NAME" header="Last Name">
    
    </cfgrid>