PDA

View Full Version : updateRecord() only updating mapped values in model



georgetintin
19 Mar 2014, 8:07 AM
Hello, I have data that looks like:


{
name : 'george',
info : {
height : '180cm',
hairColor : 'brown'
}
}

And the model maps 'hairColor' to 'info.hairColour' and a form uses 'hairColor' as it's name. All works great until you change the hair color to 'blue' and call form.updateRecord() in that it will only update the mapped version and not the original, so your data ends up as:


{
name : 'george',
info : {
height : '180cm',
hairColor : 'brown'
},
hairColor : 'blue'
}

Am I doing something horrendously wrong?

Many thanks!

georgetintin
25 Mar 2014, 7:09 AM
Does anyone have any ideas, please?Thank you!

georgetintin
31 Mar 2014, 2:53 AM
Still need help with this, any ideas?

georgetintin
7 Apr 2014, 5:43 AM
Hmm, anyone able to help, please? :(

georgetintin
10 Apr 2014, 11:41 PM
Bump.