1

Is there a way to bind a model to a fieldset so that code like this can be avoided (manually setting each field of a model).

var vals = this.getUserDetail().getValues(),
            rec = this.getUserDetail().getRecord(),
            errorObject; // Ext.data.Errors
        rec.set('first', vals.first);
        rec.set('last', vals.last);
        rec.set('email', vals.email);
        errorObject = rec.validate();
nsg
  • 10,510
  • 4
  • 21
  • 32

2 Answers2

1

You need to bind the record to the form, not the fieldset.

OhmzTech
  • 897
  • 1
  • 5
  • 7
0

yes in the same way as the form has a .getValues() method.

You can use setValues({obj...}) to update the form values. If your are using a "model/record" you might have to use form.setValues(Model.data).

link

Adam Marshall
  • 5,895
  • 2
  • 22
  • 22