This commit is contained in:
2021-02-09 18:57:27 +00:00
parent ced339eac5
commit bf80df7354
3 changed files with 13 additions and 15 deletions

View File

@@ -208,10 +208,13 @@ export default {
default: "{}",
type: String
},
formKey: String, //used to grab template from store
formKey: { type: String, default: "" }, //used to grab template from store
readonly: Boolean,
disabled: Boolean,
parentVM: Object
parentVM: {
default: null,
type: Object
}
},
methods: {
@@ -238,13 +241,11 @@ export default {
return template.find(z => z.type != undefined);
},
GetValueForField: function(dataKey) {
if (this.value == null) {
//return null;
this.value = "{}";
}
let cData = {};
//get the data out of the JSON string value
let cData = JSON.parse(this.value);
if (this.value != null) {
cData = JSON.parse(this.value);
}
//Custom field types can be changed by the user and cause old entered data to be invalid for that field type
//Here we need to take action if the data is of an incompatible type for the control field type and attempt to coerce or simply nullify if not co-ercable the data
@@ -334,10 +335,11 @@ export default {
SetValueForField: function(dataKey, newValue) {
//Get the current data out of the json string value
//
if (this.value == null) {
this.value = "{}";
let cData = {};
if (this.value != null) {
cData = JSON.parse(this.value);
}
let cData = JSON.parse(this.value);
if (!window.$gz.util.has(cData, dataKey)) {
cData[dataKey] = null;
}

View File

@@ -102,7 +102,6 @@ export default {
return true;
},
input(e) {
console.log("input", e);
this.tagSearchEntry = "";
this.$emit("input", e);
},