Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I replace the cfgridkey with my own custom variable name? Or else build my own href?
    primarykey
    data
    text
    <p>I have a simple cfgrid that's displaying my ids. I want the id to be a link to a new page, passing a url parameter of "myID" with the id value.</p> <p>I've tried this code: </p> <pre><code>&lt;cfgrid name="myGrid" query="myQuery" format="html"&gt; &lt;cfgridcolumn name="myID" href="mynewpage.cfm" /&gt; &lt;/cfgrid&gt; </code></pre> <p>But this takes me to the url "mynewpage.cfm?<strong>hrefkey</strong>=111". What I really want is "mynewpage.cfm?<strong>myID</strong>=111". Is there any way to specify what the name of the url parameter should be?</p> <p>I've also tried:</p> <pre><code>&lt;cfgrid name="myGrid" query="myQuery" format="html"&gt; &lt;cfgridcolumn name="myID" href="mynewpage.cfm?myID=#myID#" /&gt; &lt;/cfgrid&gt; </code></pre> <p>But then I get the error "<code>myID is not defined</code>". Is there any way to reference query field values from within a cfgridcolumn tag?</p> <p><strong>UPDATE:</strong></p> <p>Another thing I've tried - building the string in the sql query so that I return a column called <code>myURL</code> with a value of "mynewpage.cfm?myID=111", and then using that column for the href attribute:</p> <pre><code>&lt;cfgrid name="myGrid" query="myQuery" format="html"&gt; &lt;cfgridcolumn name="myID" href="#myURL#" /&gt; &lt;/cfgrid&gt; </code></pre> <p>According to the <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_g-h_04.html" rel="nofollow">coldfusion documentation</a> you should be able to do this:</p> <blockquote> <p>href - URL <em>or query column name</em> that contains a URL to hyperlink each grid column with. </p> </blockquote> <p>(italics mine)</p> <p>But I get the error "<code>myURL is not defined</code>". How do I set the href to a column rather than a literal url value?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload