This commit is contained in:
2019-03-22 19:26:07 +00:00
parent 899422da75
commit 80034af489

View File

@@ -17,6 +17,31 @@ function isEmpty(o) {
return !o;
}
////////////////////////////////////
// Get control from ref
//
function getControl(ref) {
var ctrl = v.$refs[ref];
if (isEmpty(ctrl)) {
return null;
}
}
////////////////////////////////////
// Get value from control
//
function getControlValue(ctrl) {
var value = ctrl.value;
return value;
}
////////////////////////////////////
// Get field name from control
//
function getControlFieldName(ctrl) {
return ctrl.label;
}
export default {
/*
ctrl.$refs[ref].value
@@ -40,13 +65,13 @@ ctrl.$refs[ref].initialValue
// err = _.replace(err, "{0}", fieldName);
// return err;
// },
Required(v, ref) {HERE DID THIS METHOD OVER TO NEW WAY USING REF, NOW TO DO THE REST
var ctrl = v.$refs[ref];
if (isEmpty(ctrl)) {
Required(v, ref) {
var ctrl = getControl(ref);
if (!ctrl) {
return false;
}
var value = ctrl.value;
var value = getControlValue(ctrl);
if (!isEmpty(value)) {
return false;
}
@@ -61,7 +86,8 @@ ctrl.$refs[ref].initialValue
},
///////////////////////////////
// MAXLENGTH
MaxLength(ltkey, value, max) {
//MaxLength(ltkey, value, max) {
MaxLength(v, ref) {
if (_.isEmpty(value)) {
return false;
}