This content has been marked as final. Show 5 replies
Try the following:
<cfgrid name="mygrid" query="getproducts">
<cfgridcolumn name="prod" href="#order_url# hrefkey="product">
When you click on the href link it will pass the value of the product in CFGRIDKEY. See "Using the href attribute" in http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=ColdFusion_Documentation&file=00000266.htm.
Then when you do your where clause on your linked page it will be WHERE PRODUCT=#URL.CFGRIDKEY#.
I am trying to do something similar - I want the user to be able to navigate to a non-cfm page to do an employee lookup from a corporate ldap using a list of employees in a cfgrid. How can I get this to work?
The search string should look like this (assuming 1111 is the employee number):
Here is my code so far:
<cfgrid name="mygrid" query="get_employees">
<cfgridcolumn name="staff_id_nbr" href=" http://myhome.com/employee_lookup?Search=#get_employees.staff_id_nbr#" target="_blank" >
This is the result (displays the employee info, but adds too much info to the address):
http://myhome.com/employee_lookup?Search1111&CFGRIDKEY=1111%2CAblay%2CMaria%2CSr+Technical +Analyst%2CCompanyx+Services%2C111-484-2477%2CJean%2CKimberly+McFadden-Effinger%2CUrsula+S teele%2CScot+Struminger%2CEric+Keane%2CRMTC%2CWN%2C243%2C%2Cmaria.ablay%40company.com%2C%2 C
How do I get rid of all the garbage, starting with &CFGRIDKEY? Some of it is Employee LDAP info, but I'm most concerned about the &CFGRIDKEY=1111. I tried using the hrefkey in various ways, but luck. Thanks...
I get all that same garbage as well. How can I clean it up so that original "=" and "&" symbols show up?
My next page won't even recognize the URL variables because of all that %3D%3f%26 garbage.
I was in the same situation as you folks. Closer inspection of the documentation led me to the solution:
The key is to ensure that you have the following three parameters in your cfgrid tag:
href (for the url - you can add any other parameters you want to pass here)
hrefkey (the id you want to pass through to the target page)
appendkey (the attribute you were missing - according to the docs, this is required)
<cfgridcolumn name="PK_MY_PRIMARY_KEY" display="no" />
<cfgridcolumn name="DISPLAYCOL1" header="Col1Header" />
<cfgridcolumn name="DISPLAYCOL2" header="ColHeader2" />
<cfgridcolumn name="DISPLAYCOL3" header="ColHeader3" />
Hope that helps.
> <cfgrid name="myGrid"
you surely meant PK_MY_PRIMARY_KEY, didn't you?
(sorry if you edited your post and corrected it - i read these forums as
nntp/news and do not get post edits...)