1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    33
    Answers
    3
    Vote Rating
    1
    Forn is on a distinguished road

      0  

    Default Answered: form.updateRecord dont word

    Answered: form.updateRecord dont word


    Hello. I have the next work:
    Code:
    formPersonalData = Ext.getCmp('formPersonalData').getForm();
            if (formPersonalData.isValid()){
                formPersonalData.updateRecord(currentCustomer);
                currentCustomer = formPersonalData.getRecord();
                currentCustomer.save({
                    success: function(record){
                        Ext.Mesg.alert('Сообщение', 'Данные сохранены.');
                    },
                    failure: function(record){
                        Ext.MessageBox.show({
                            title: 'Ошибка',
                            msg: 'Ошибки при сохранении данных. Обратитесь к администратору.',
                            buttons: Ext.MessageBox.OK,
                            icon: Ext.MessageBox.ERROR
                        });
                    },
                })
            }
    but when the update request send the data in the currentCustomer is that is was before changes in the form.

    What I do wrong?

  2. Problem was solved I must add name for each element except Id.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,996
    Answers
    664
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Perhaps if you switch the order of these 2 lines?:

    Code:
    formPersonalData.updateRecord(currentCustomer);
    currentCustomer = formPersonalData.getRecord();
    Regards,
    Scott.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    33
    Answers
    3
    Vote Rating
    1
    Forn is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    Perhaps if you switch the order of these 2 lines?:
    Not work. In documentation formPersonalData.updateRecord(currentCustomer); - this must update the currentCustomer from form field, but it not work

  5. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    33
    Answers
    3
    Vote Rating
    1
    Forn is on a distinguished road

      0  

    Default


    Problem was solved I must add name for each element except Id.

Thread Participants: 1