PDA

View Full Version : How can I force a data.store to save a record to the server



bareflix
21 Jul 2013, 2:15 PM
I am loading records with an extDirect data store. I display a record in a form, then call:


this.getForm().updateRecord(this.record);

If I have made changes in the form, the record will be written to the server as expected.

However, I have a case where I need to programmatically change one of the fields in the record, and the user may not need to change anything manually. In that case, the record is not written to the server, because somewhere something is being "smart" and thinks there was no change.
I tried calling:


this.record.setDirty ();

after updateRecord, but it had no effect. I also tried:


this.record.commit ();

That did not work either.
Any other suggestions?

Renan Cunha
22 Jul 2013, 4:21 PM
How you changed the record data? You used the set method of your model to set the property values?
The set method will automatically mark the model as changed...