1 Reply Latest reply on May 5, 2011 11:56 PM by saurav Pandit

    Pass URL variable from CFGRID without the word GRIDKEY being appended

    clcatbpg Level 1

      I have an application where I return a list of packages that were shipped and one of the columns shown is the FedEx tracking number. I want the user to be able to click on the tracking number as a link and then to be taken directly to the FedEx website to see more details of the package.

       

      I am using a CFGRID to display the data and the CFGRIDCOLUMN named "Tracking" below has the proper URL to take the user to FedEx's website and track the package. My problem is that if I set the "appendkey" attribute to "yes" then it appends the word GRIDKEY prior to the value I want to pass and the FedEx website does not understand GRIDKEY. If I set the attribute to "no" it does not append the tracking number.

       

      Details of the CFGRID are below -

       

      Is it possible, using a CFGRID to pass a grid column result to a URL without the word GRIDKEY being included?

       

      If I reference the query variable name and include it inside the HREF information then it always passes the value in row #1, not the row that the user has clicked on.

       

      Any help would be greatly appreciated.

       

      Thanks.

       

       

              <cfgrid name="TrackingList"

                query = "qTracking"

                    width="900"

                    height="300"

                    rowheaderalign="left"

                    rowheadertextcolor="##003399"

                    bindonload="true"

                    appendkey="no"

                    autowidth="true"

                    griddataalign="left"

                    gridlines="yes"

                    colheaderalign="left"

                    selectmode="single"

                    enabled="yes"

                    visible="yes"

                    format="html"

                    preservepageonsort="false"

                    striperowcolor="##FFFFCC"

                    striperows="no"

                    selectonload="true">

       

                      <cfgridcolumn name="Package" width="100" header="Package Number" />

                      <cfgridcolumn name="Quantity" width="50" header="Qty" />

                      <cfgridcolumn name="Shipped" width="50" header="Shipped" type="boolean"/>

                      <cfgridcolumn name="Carrier" width="50" header="Carrier" />

                      <cfgridcolumn name="Tracking" width="100" header="Tracking Number" Target ="_blank"   href="http://www.fedex.com/Tracking?action=track&language=english&cntry_code=us&initial=x&trackn umbers=" hrefkey="Tracking" />

                      <cfgridcolumn name="Status" width="150" header="Status" />

                      <cfgridcolumn name="ShipDate" width="75" header="Ship Date" mask="m/d/Y" />

                      <cfgridcolumn name="PODDate" width="75"   header="Del. Date" mask="m/d/Y" />

                      <cfgridcolumn name="PODTime" width="75"  header="Del. Time" mask="h:m A" />

                      <cfgridcolumn name="PODSig" width="150" header="Signature" />     

       

          </cfgrid>  

        • 1. Re: Pass URL variable from CFGRID without the word GRIDKEY being appended
          saurav Pandit Level 1

          Hi clcatbpg,

              I have faced the same problem before and what i found that there is no direct way to add url parameter (except Cfgridkey).

              So my suggestion is change the query(from where you are getting data) itself like following.

           

          Step1:Add a seperate coloumn query

                     You can do this by QueryAddColumn(query, column-name [, datatype], array-name) in coldfusion.

           

          Step2:Put the url in that coloumn        

                    Loop over the query to get the parameter value and use QuerySetCell(query, column_name, value [, row_number ]) to set data in cell.

                    The cell value will be like <a href="arrress?param=#value#">Name</a>

           

          Step3:Use the column in CFGRID   

                      <cfgridcolumn name="name of the new coloumn" />

           

          Thanks

          Saurav