This commit is contained in:
@@ -52,6 +52,7 @@ function getControl(vm, ref) {
|
||||
var customFields = vm.$refs["customFields"];
|
||||
if (customFields !== undefined) {
|
||||
ctrl = customFields.$refs[ref];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,20 +72,28 @@ function getControl(vm, ref) {
|
||||
//
|
||||
function getControlValue(ctrl) {
|
||||
var value = ctrl.value;
|
||||
// if(value==undefined){
|
||||
// debugger;
|
||||
// if(ctrl._props){
|
||||
// var subvalue=ctrl._props;
|
||||
|
||||
// }
|
||||
// }
|
||||
return value;
|
||||
//vm.$refs["customFields"]._computedWatchers.c2.value
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
// Get field name from control
|
||||
//
|
||||
function getControlLabel(ctrl) {
|
||||
// if (window.$gz.errorHandler.developmentModeShowErrorsImmediately) {
|
||||
// if (!ctrl.label) {
|
||||
// debugger;
|
||||
// throw "gzform:getControlLabel - the control has no label " + ctrl;
|
||||
// }
|
||||
// }
|
||||
return ctrl.label;
|
||||
|
||||
if(ctrl.label==undefined){
|
||||
return "UNKNOWN CONTROL";
|
||||
}else{
|
||||
return ctrl.label;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
@@ -142,14 +151,20 @@ function getErrorBoxErrors(vm, errs) {
|
||||
}
|
||||
|
||||
export default {
|
||||
todo: make a customFieldsCheck() rule, see todo.txt top item under "now"
|
||||
///////////////////////////////
|
||||
// REQUIRED
|
||||
//
|
||||
required(vm, ref) {
|
||||
required(vm, ref, subvm) {
|
||||
if (vm.formState.loading) {
|
||||
return false;
|
||||
}
|
||||
//debugger;
|
||||
|
||||
if(subvm){
|
||||
debugger;
|
||||
console.log("gzform:required() being called from custom fields control: ref=" + ref + " customFields value = " + vm.$refs.customFields.value);
|
||||
|
||||
}
|
||||
var ctrl = getControl(vm, ref);
|
||||
if (typeof ctrl == "undefined") {
|
||||
return false;
|
||||
@@ -159,6 +174,7 @@ export default {
|
||||
if (!isEmpty(value)) {
|
||||
return false;
|
||||
}
|
||||
// console.log("gzform:required() -> Control " + ref + " is empty! returning errror");
|
||||
|
||||
// "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}",
|
||||
var err = window.$gz.locale.get("ErrorRequiredFieldEmpty");
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
:label="lt(item.fld)"
|
||||
:ref="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[form().required(parentVM, item.fld)]"
|
||||
:rules="[form().required(parentVM, item.fld, _self)]"
|
||||
auto-grow
|
||||
clearable
|
||||
></v-textarea>
|
||||
@@ -218,7 +218,7 @@ export default {
|
||||
this.$emit("update:value", ret);
|
||||
//this triggers the onchange routine in the parent form
|
||||
//mainly for custom fields purposes so that the dirty checking works
|
||||
this.$emit("change");
|
||||
this.$emit("change",ret);
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
|
||||
@@ -573,6 +573,10 @@ export default {
|
||||
});
|
||||
}
|
||||
}
|
||||
// ,
|
||||
// getCustomFieldValue(fld) {
|
||||
// return this.$refs["customFields"].$refs[fld].$props.value;
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user