PDA

View Full Version : How to update/replace an existing record



thachun
6 Apr 2012, 6:02 PM
Hi all,

I have spent for a while to find a method to update an existing record. I suppose to achieve that by the Add method but it threw an exception like " Uncaught TypeError: Cannot read property 'internalId' of undefined", even I set the propertyId in the Model.

Cheers,
Thac

scottmartin
7 Apr 2012, 7:31 AM
See if this help:



values = form.getValues(), // get form changes
record.set(values); // set change to record;


You can also use ( see beginEdit/endEdit )


var rec = this.form.getRecord();
form.getForm().updateRecord();
rec.save({ .. });


Regards,
Scott.