-
2 Oct 2008 6:20 AM #1
[2.2][CLOSED] BasicForm.updateRecord updates clears values
[2.2][CLOSED] BasicForm.updateRecord updates clears values
Reprosteps:
1. load record into form with form.loadRecord(rec);
2. save form back into record with form.updateRecord(rec);
Expected:
form will update only fields which are included in form
Actual:
form.updateRecord(rec); updates fields in form and it also clears all other values that are not in form
Example:
some Record type
if you have a form with fields id, name, description and you run form.updateRecord(rec); then fields that were not in form (fake, parameters) are cleared.Code:GroupRecord = Ext.data.Record.create([ {name: 'id', type: 'int', mapping: 'id'}, {name: 'name', type: 'string', mapping: 'name'}, {name: 'description', type: 'string'}, {name: 'fake', type: 'string'}, {name: 'parameters', type: 'string'} ]);Last edited by mystix; 2 Oct 2008 at 7:20 AM. Reason: post code in [code][/code] tags. see http://extjs.com/forum/misc.php?do=bbcode#code
-
2 Oct 2008 6:31 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
No it doesn't.
It calls findField(fieldname) for all fields in record and sets the value if the field is found.
Are you sure you don't have any components in the form (they don't have to be fields!) using the other fieldnames as id?
-
3 Oct 2008 5:48 AM #3
oh yes, you are right. today I run the same code! and it was working correctly! I don't know if browser was crazy or what.


Reply With Quote