Skip to main content
Participant
October 16, 2010
Question

How can I create a href with cfgridrow

  • October 16, 2010
  • 1 reply
  • 443 views

Basically I am using cfgrid to display a list of computer from a query.  I would lke to be able to; when I click on the first colum in any row to display a cfm page that will be able to display relevant information to a specific computer.  I will be passing parameter with theurl parameter.  Theses parameter are generated by my original query.

here is the code i am trying to use.  I didn't include the href.

This code works OK.  The 2 variables I am trying to send via URL are #machine# which is created from a query and URL.Hotel which is was send thru the URL when I opened this page. (the cfoutput tag were remove )
<!---<table border="1"
  <TR>
    <TD> PC Name </TD>
    <TD> IP Address </TD>
    <TD> User Name </TD>
  </TR>
  <cfoutput query="listRet">
  <tr>
    <td><a href="ListApp.cfm?pc=#URLEncodedFormat(Trim(Machine))#&hotel=#URL.hotel#">#Machine#</a></td>
    <td>#IPAddress#</td>
    <td>#Description#</td>
  </tr>
  </cfoutput>
</table>--->

Now can I do the same with a cfgrid and cfgrid row

<cfform format="flash">
<cfgrid
  query="listRet"
  name="gridPc"
  height="400"
  width="1000">
  <cfgridcolumn name="Machine" header="PC Name" headerbold="true" headertextcolor="blue" width="120">
  <cfgridcolumn name="Description" header="User Name" headerbold="true" headertextcolor="blue" width="250">
  <cfgridcolumn name="IPAddress" header="IP Address" headerbold="true" headertextcolor="blue" width="120">
  <cfgridcolumn name="SystemName" header="Model" headerbold="true" headertextcolor="blue" width="275">
</cfgrid>
</cfform>

Thanks

    This topic has been closed for replies.

    1 reply

    Community Expert
    October 16, 2010

    You can just use the HREF attribute of CFGRID directly, and it'll automatically pass a row-specific value. You won't be able to specify the exact URL attributes that will be passed - it'll pass a single attribute called "cfgridrow" if I recall correctly.

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

    GSA Schedule, and provides the highest caliber vendor-authorized

    instruction at our training centers, online, or onsite.

    Dave Watts, Eidolon LLC