This commit is contained in:
2021-01-20 00:32:46 +00:00
parent cc32c335e9
commit 40fadc8180
7 changed files with 53 additions and 36 deletions

View File

@@ -238,8 +238,9 @@ export default {
return template.find(z => z.type != undefined);
},
GetValueForField: function(dataKey) {
if (!this.value) {
return null;
if (this.value == null) {
//return null;
this.value = "{}";
}
//get the data out of the JSON string value
@@ -333,6 +334,9 @@ export default {
SetValueForField: function(dataKey, newValue) {
//Get the current data out of the json string value
//
if (this.value == null) {
this.value = "{}";
}
let cData = JSON.parse(this.value);
if (!window.$gz.util.has(cData, dataKey)) {
cData[dataKey] = null;

View File

@@ -38,8 +38,11 @@
//and in theory it could help if picking more than one tag that have similar selection criteria
export default {
beforeUpdate() {
// if(this.value==null){
// this.value=[];
// }
//Set the initial list items based on the record items, this only needs to be called once at init
if (!this.initialized && this.value.length > 0) {
if (!this.initialized && this.value!=null && this.value.length > 0) {
this.sourcetags = this.value;
this.initialized = true;
}
@@ -54,7 +57,11 @@ export default {
};
},
props: {
value: Array,
value: {
default: [],
type: Array
},
// value: Array,
label: String,
readonly: { type: Boolean, default: false }
},