This commit is contained in:
2019-07-18 21:53:53 +00:00
parent dc674e6836
commit a5c77af06c
2 changed files with 15 additions and 11 deletions

View File

@@ -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() {

View File

@@ -165,12 +165,14 @@
<v-flex xs12 px-2>
<gz-custom-fields
:formKey="formCustomTemplateKey"
v-model="obj.customFields"
v-bind:customfielddata.sync="obj.customFields"
:readOnly="this.formState.readOnly"
ref="customFields"
:error-messages="this.$gzform.serverErrors(this, 'customFields')"
@change="onChange('customFields')"
></gz-custom-fields>
<!-- v-model="obj.customFields" -->
</v-flex>
</v-layout>
<!-- <v-layout align-left justify-center row wrap mt-5>