PDA

View Full Version : [FIXED][PR4] Model record copying, Ext.data.Model.id does not generate new ID



4CastRisk
16 Mar 2011, 11:18 AM
http://dev.sencha.com/deploy/ext-4.0-pr4/docs/api/Ext.data.Model.html#copy

I have the following code for a copy button on a grid:



handlerCopy: (button, event) ->
record = @getSelectionModel().getSelection()[0]
if not record
Ext.Msg.alert 'Copy Error', 'You must select a row to copy'
return
else
copy = record.copy()
Ext.data.Model.id copy
copy.setDirty()
@store.insert 0, copy


The record itself does copy, but no new ID is generated, so the same record gets inserted into the store, so cannot be saved.

evant
16 Mar 2011, 10:40 PM
This will be resolved in the next release.