From 31563a634f36a4ee708d414ea0723d81a6abda5b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 18 Jul 2019 19:29:21 +0000 Subject: [PATCH] --- .../src/components/custom-fields-control.vue | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index cd4739bb..4b6d3f46 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -127,17 +127,28 @@ export default { computed: { c2: { get: function() { - debugger; - return "this is my test"; + return this.GetValueForField("c2"); }, set: function(newValue) { - debugger; + this.SetValueForField("c2", newValue); } } }, methods: { lt: function(ltkey) { return this.$gzlocale.get(ltkey); + }, + GetValueForField: function(dataKey) { + if (!this.value) { + return null; + } + // debugger; + var cData = JSON.parse(this.value); + // debugger; + return cData[dataKey]; + }, + SetValueForField: function(dataKey, newValue) { + console.log("Setting " + dataKey + " TO " + newValue); } }, beforeCreate() { @@ -172,4 +183,14 @@ export default { //"c3":30453626,"c4":false,"c5":0.529134196010015} } }; + +// ////////////////////// +// // Get the data for the specified field key from the custom fields object +// // coerce the type if necessary / handle incompatible types +// function GetDataForField(fldKey, vm) { +// debugger; +// var cData = JSON.parse(vm.value); +// debugger; +// return "BaLH"; +// }