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:328620
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to