This commit is contained in:
@@ -197,17 +197,31 @@ export default {
|
||||
SetValueForField: function(dataKey, newValue) {
|
||||
//https://stackoverflow.com/questions/39868963/vue-2-mutating-props-vue-warn
|
||||
|
||||
//debugger;
|
||||
debugger;
|
||||
|
||||
|
||||
|
||||
//Ok, could end up here with no value set yet at all for the entire custom fields control as it's a new record or something so...
|
||||
//what are valid values for custom fields on a new record, completely empty?
|
||||
// if(this.value=== null || this.value===undefined){
|
||||
// this.value="{\"" + dataKey+"\":null}";
|
||||
// }
|
||||
|
||||
if(this.value=== null || this.value===undefined){
|
||||
this.value="{}";//empty json fragment
|
||||
}
|
||||
|
||||
//Get the data out of the json string value
|
||||
//
|
||||
var cData = JSON.parse(this.value);
|
||||
if (!window.$gz._.has(cData, dataKey)) {
|
||||
cData[dataKey]=null;
|
||||
}
|
||||
|
||||
//handle null or undefined
|
||||
if (newValue === null || newValue === undefined) {
|
||||
cData[dataKey] = null;
|
||||
} else {
|
||||
|
||||
} else {
|
||||
//then set item in the cData
|
||||
|
||||
//TODO: This will likely need also to be converted because dates and stuff
|
||||
|
||||
Reference in New Issue
Block a user