You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
Repository navigation
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
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!