user1186309
user1186309

Reputation: 15

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,

Upvotes: 0

Views: 1212

Answers (1)

Matt Busche
Matt Busche

Reputation: 14333

<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>

Upvotes: 4

Related Questions