2 Replies Latest reply on Feb 23, 2010 6:48 AM by rmorgan

    cfgrid insert issue

    rmorgan Level 1


      I am having a small issue with inserting new rows into a grid and is flaky about it, sometimes it works and sometimes it does not. Here is what appears to be happening(some of the time that is). Once the page is loaded and displaying the grid, I can press the insert button and it will expand the grid to show a blank row waiting for some data. I type the data in and hit submit and it processes the form and sends me back to grid, but does not show the new insert.


      It seems that once I type in the data I need to click off of the cell and bring the focus to something else and hit submit it does seem to work, but if I press the submit button while the new cell still has the cursor focus is when it seems to mostly fail.


      Any suggestions on what is exactly going on here or how to fix it? TIA.

        • 1. Re: cfgrid insert issue
          Adam Cameron. Level 5

          Can you pls post a small/simple, self-contained code example that demonstrates this happening?




          • 2. Re: cfgrid insert issue
            rmorgan Level 1

            First page:

            <cfform action="editaffiliatetypeaction.cfm" method="post">
            <cfgrid name="editaffiliatetypegrid" selectmode="edit" insert="yes" insertbutton="Insert"delete="yes" deletebutton="Delete" query="getaffiliatetype">


            <cfgridcolumn name="affiliatetype_id" header="affiliatetype_ID" display="no">
            <cfgridcolumn name="affiliatetype" header="Affiliate Type" display="yes" width="255">


            </cfgrid><br />
            <cfinput type="submit" name="submit" value="submit">




            Action page:

            <CFIF IsDefined("form.editaffiliatetypegrid.rowstatus.action")>


                <CFLOOP INDEX = "Counter" FROM = "1" TO =


                The row action for #Counter# is:


                <CFIF form.editaffiliatetypegrid.rowstatus.action[Counter] IS "D">
                <CFQUERY NAME="DeleteAffiliatetype" DATASOURCE="#dsn#">
                    DELETE from affiliatetype
                    WHERE affiliatetype_id=#form.editaffiliatetypegrid.original.affiliatetype_id[Counter]#


            <CFELSEIF form.editaffiliatetypegrid.rowstatus.action[Counter] IS "U">


                <CFQUERY NAME="UpdateExistingAffiliatetype" DATASOURCE="#dsn#">
                    UPDATE affiliatetype
                    SET affiliatetype='#form.editaffiliatetypegrid.affiliatetype[Counter]#'
                    WHERE affiliatetype_id=#form.editaffiliatetypegrid.original.affiliatetype_id[Counter]#


            <CFELSEIF form.editaffiliatetypegrid.rowstatus.action[Counter] IS "I">


                <CFQUERY NAME="InsertNewAffiliatetype" DATASOURCE="#dsn#">
                    INSERT into affiliatetype
                    VALUES ('#form.editaffiliatetypegrid.affiliatetype[Counter]#')




            <cflocation url="editaffiliatetype.cfm">