1. #1
    Ext User
    Join Date
    Jul 2007
    Posts
    12
    Vote Rating
    0
    igo is on a distinguished road

      0  

    Exclamation [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
    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'}
    ]);
    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.
    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. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    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. #3
    Ext User
    Join Date
    Jul 2007
    Posts
    12
    Vote Rating
    0
    igo is on a distinguished road

      0  

    Talking


    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.

Thread Participants: 1