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
What I would inevitably like to do is find the 'trait' object from the array by 'AttrName', and set it directly, avoiding needing to know the index and still updating the top level model.
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!
The text was updated successfully, but these errors were encountered: