This week I was working on a cfgrid example for a reader. He needed some help understanding the FORM data on the server side when you've done multiple edits to a grid (and if folks want me to pass along what I told him, just say). It's a bit complex so I wrote up a quick demo and explained how the form data related to what was done on the client side.
During this work I discovered an unfortunate bug with cfgrid and editable grids. If your grid supports deletes along with edits (by using delete="true" in the cfgrid tag), you can run into an issue where one of your edits will not be passed to the server. What I noticed was that if I edited rows A and B, and then deleted some row C, my form data included the edits for A and the delete for C, but completely lost the edit for B.
I was able to reproduce this in two browsers, and Adam Tuttle was able to reproduce it as well. I've file a bug report for it and if you want to quickly test this yourself, just try the code below.
Unfortunately there isn't really a workaround for this. For now I simply do not recommend using an editable grid that supports delete as well.
<cfquery name="art" datasource="cfartgallery" maxrows="10">
select *
from art
</cfquery>
<cfform name="gridform1">
<cfgrid name ="test_data"
format="html"
font="Tahoma"
fontsize="12"
query = "art"
selectmode="edit"
striperows="yes"
delete="true"
>
<cfgridcolumn name="artid" display="false" />
<cfgridcolumn name="artname" display="true" header="Art" select="no" />
<cfgridcolumn name="price" display="true" header="price" select="yes" />
<cfgridcolumn name="issold" display="true" header="Sold" select="no" />
<cfgridcolumn name="largeimage" display="true" header="largeimage" select="yes" />
</cfgrid>
<cfinput name="submit" type="Submit" value="Submit">
</cfform>
<cfdump var="#form#">
Archived Comments
This happens because cfgrid which is inside cffrom uses aynchronous call ; internally using flash remoting. Depending on the frequency of click or edite or delete you are expected to see varying result because data may still be on the netowork pipeline.
I don't believe you are right. As far as I know it isn't doing any posts at all to the server, not till I hit submit.
Just tested with Charles and there were no Flash Remoting requests done in the background. To be clear, this is the Ajax grid, not the older Flash Form cfgrid.
You got me if you are using Ajax grid :)
There's also a bug in older versions of safari... trapping for double click events doesn't work. I haven't found a work-around yet.
Can't tell you how disapointed with CGGRID we are, simple stuff just doesn't even with CF9.
Try doing a right aligned column that sorts numerically, one of the most common things you might do in a grid.
That's unfortunate. All I can recommend is jqGrid again - but I tend to go jQuery in almost every case. ;)