Skip to content

Conversation

@adriano-di-giovanni
Copy link

render method of Form.editors.NestedModel defined this.nestedForm as follows:

  render: function() {
    //Get the constructor for creating the nested form; i.e. the same constructor as used by the parent form
    var NestedForm = this.form.constructor;

    ...

    //Wrap the data in a model if it isn't already a model instance
    var modelInstance = (data.constructor === nestedModel) ? data : new nestedModel(data);

    this.nestedForm = new NestedForm({
      model: modelInstance,
      idPrefix: this.id + '_',
      fieldTemplate: 'nestedField'
    });

Thus, idPrefix attribute for NestedForm options hash was always undefined_.

I changed the line idPrefix: this.id + ' ' to idPrefix: modelInstance.cid in order to have unique field ids.

I also built for distribution.

I think it is now correct. If it's not, please feel free to reject my pull request: you won't hurt my feelings :)

@adriano-di-giovanni
Copy link
Author

I also changed version number and built again for distribution. I did it because I need to consume my fork with bower. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant