matt_stutts 0 Newbie Poster

Seems like this should be straightforward...


I have a cfgrid that allows a user to insert a new row (insert='yes').

One column in the cfgrid is hidden but carries the uniqueID.

Upon updating changes back to the table in the db, I need for that field to be populated w/the correct uniqueID (CR_ID).


All the rows in this table would have the same ID b/c they are being called from a query based on that ID.

It is important that the ID row is not itself editable. I simply want to use post the correct ID back to the db for that new row, instead of having an empty cell.

<cfgrid
        name="idGrid"
        title="Related IDs"
        query="get_IDs"
        selectmode="edit" insert="yes" insertbutton="Insert New ID" enabled="yes" visible="yes"
        format="html" preservepageonsort="true">
      <cfgridcolumn name="CR_ID" display="No" select="no"/>
      <cfgridcolumn name="ID" header="ID" />
      <cfgridcolumn name="IDType" header="ID Source" values="#r_idType#" valuesdisplay="#r_idType#" valuesdelimiter=","/>
    </cfgrid>


was populated by:

<!-- query all ID records based on passed CR_ID -->
<cfquery name="get_IDs" datasource="bridges">
SELECT tblIDs.CR_ID, tblIDs.ID, tblIDs.IDType
FROM tblIDs
WHERE tblIDs.CR_ID = '#CFGRIDKEY#'
</cfquery>

Need to post changes to records in cfgrid back to tblIDs including any new rows with that CR_ID put into the field for the new record!