NVM. I just reread your post and realized what you were trying to teach me.
Basically, The user types data into the first row. I put that row into the DB. Update the datastore. Reload the Grid. then the user can click on insert again and a new row will be appended to the grid. Repeat as many times as necessary. On Mon, Nov 23, 2009 at 3:44 PM, Won Lee <[email protected]> wrote: > Sorry for the poor explanation of my problem. > > This is always a new grid. There is no data I am binding. I do not create > the store. I assume the CF server is creating the DataStore. > I want the user to be able to add as many rows to the grid as they need. > > As of right now I am not making any DB calls. > > I type in what I want in the first row. I click 'insert' and a new row > should be appended. This happens on the first click. The second time I > click 'insert' I get a JS error. > > PS I used the term insert to stay true with the CF9 docs. I didn't mean a > SQL insertion. > > > > > > > > > On Mon, Nov 23, 2009 at 3:08 PM, Cutter (ColdFusion) < > [email protected]> wrote: > >> >> Ah, yes. But, a complete ExtJs solution would be much more... >> >> OK, that (not) said, cfgrid does have problems with multiple insertions. >> Or, rather, it doesn't really deal with them well. When you insert a >> line, it gives the underlying Ext store record some default values. This >> includes the id, which could be either '0' or empty. Once you've posted >> back to the server, if you haven't updated that record with the id given >> at the server level, then the next time you attempt to insert a line... >> >> Well, you get the idea. What you might do is reload the data store after >> inserting to the server. This does hit the server again to reload your >> grid, but it also ensures correct data after it re-renders. Check out >> the Ext.grid.GridPanel and Ext.data.Store API's on the ExtJs site for >> more information. >> >> Steve "Cutter" Blades >> Adobe Certified Professional >> Advanced Macromedia ColdFusion MX 7 Developer >> >> Co-Author of "Learning Ext JS" >> http://www.packtpub.com/learning-ext-js/book >> _____________________________ >> http://blog.cutterscrossing.com >> >> >> >> Won Lee wrote: >> > Using CF9 Developer edition >> > version 9. 0. 0. 251028 >> > >> > Anyone else have issues with trying to insert more than one row in >> cfgrid? >> > >> > <cfquery name="getOutcome" datasource="#application.dsn#"> >> > select * from l_outcomes >> > </cfquery> >> > <cfquery name="getSerious" datasource="#application.dsn#"> >> > select * from l_serious_criteria >> > </cfquery> >> > <cfset variables.outcome = valuelist(getOutcome.outcome)> >> > <cfset variables.serious = valuelist(getSerious.serious_criteria)> >> > <cfform name="event_form" action="event_action.cfm" method="post"> >> > <cfgrid format="html" name="event" selectmode="edit" insert="yes" >> > delete="yes"> >> > <cfgridcolumn name="reported_terms" header="Reported Terms"> >> > <cfgridcolumn name="onset_date" header="Onset Date" type="date" >> > mask="dMY"> >> > <cfgridcolumn name="outcome" header="Outcome" >> values="#variables.outcome#" >> > valuesdisplay="#variables.outcome#" select="true"> >> > <cfgridcolumn name="abated_date" header="Abated Date" type="date" >> > mask="dMY"> >> > <cfgridcolumn name="serious_criteria" header="Serious Criteria" >> > values="#variables.serious#" valuesdisplay="#variables.serious#" >> > select="true" width="600"> >> > </cfgrid> >> > </cfform> >> > >> > I rather not have to build out all the ext for a new grid. >> > >> > >> > >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328624 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

