Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Cannot set property of nested array by index dynamically #127

Description

@daveed80

I'm attempting to set a property of a nested array dynamically but am unable to do so.

Model :

{"Alias":"sample","Id":0,
Traits: [
{"AttrValue":null},
{"AttrValue":null}
]
}

This of course works fine:

// this.model.set({ 'Traits[0].AttrValue': 'test' });

This does not:

// var i = 2;
// var prop = 'Traits[' + i + '].AttrValue';
// this.model.set({' prop ' : 'test'});

I'm sure I just can't see the sailboat at the moment (exhaustion) so any help would be greatly appreciated.

Thanks in advance!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions