From a5c77af06caab3cd7bc2f2df273e3dad9c4c4526 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 18 Jul 2019 21:53:53 +0000 Subject: [PATCH] --- .../src/components/custom-fields-control.vue | 22 ++++++++++--------- ayanova/src/views/inventory-widget-edit.vue | 4 +++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index e0a21b22..e582a77d 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -113,16 +113,17 @@ export default { }, props: { value: String, + customfielddata: String, formKey: String, //used to grab template from store readOnly: Boolean }, watch: { - value(val) { - //this ensures the parent form gets the onchange event - //not actually sure why there are two here but it worked with the datetime picker so I replicated it here - this.$emit("input", val); - this.$emit("change", val); - } + // value(val) { + // //this ensures the parent form gets the onchange event + // //not actually sure why there are two here but it worked with the datetime picker so I replicated it here + // this.$emit("input", val); + // this.$emit("change", val); + // } }, computed: { c2: { @@ -139,12 +140,12 @@ export default { return this.$gzlocale.get(ltkey); }, GetValueForField: function(dataKey) { - if (!this.value) { + if (!this.customfielddata) { return null; } // debugger; //get the data out of the JSON string value - var cData = JSON.parse(this.value); + var cData = JSON.parse(this.customfielddata); //get the type it *should* be //TODO: method here @@ -160,7 +161,7 @@ export default { //Get the data out of the json string value // - var cData = JSON.parse(this.value); + var cData = JSON.parse(this.customfielddata); //then set item in the cData //initial naive attempt: (tostring is suspect) @@ -177,7 +178,8 @@ Avoid mutating a prop directly since the value will be overwritten whenever the //MAYBE I need to modify the value object, not simply replace it (somehow?) */ - this.value=JSON.stringify(cData) + //this.value=JSON.stringify(cData) + this.$emit('update:customfielddata', JSON.stringify(cData)); } }, beforeCreate() { diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 6d942f11..4fbec342 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -165,12 +165,14 @@ +