This commit is contained in:
2021-02-22 21:06:17 +00:00
parent 98d33c010a
commit b259584b85
3 changed files with 14 additions and 9 deletions

View File

@@ -83,7 +83,7 @@ function getControlLabel(ctrl) {
// Get errors for a particular field
// from server error collection
//
function getErrorsForField(vm, ref) {
function getErrorsForField(vm, ref, index) {
//Note: to debug this on forms just put {{ formState.serverError }}
//on the form to see what is actually stored there and should be showing
let ret = [];
@@ -143,9 +143,7 @@ export default {
if (vm.formState.loading) {
return true;
}
// if (ref == "Items.PartId") {
// debugger;
// }
let ctrl = getControl(vm, ref);
if (typeof ctrl == "undefined") {
// console.log("gzform:required rule - bailing due to undefined", ref);
@@ -683,8 +681,6 @@ export default {
// NOTE: that in a form this should only be used with non stock-required fields, if they are already required they cannot be hidden
//
showMe(vm, formCustomTemplateFieldName) {
//TODO: CHILD COLLECTION MOD handle dot notation path indexed collection etc
// possibly it will just work since the key will match but double check
//special check for wiki field
//if read only then can't add any content and if no content then no reason to show it at all
if (formCustomTemplateFieldName == "wiki") {
@@ -748,7 +744,6 @@ export default {
// This is required so that server errors can be cleared when input is changed
// formReference is an optional string name of the form ref property if alternative named form
fieldValueChanged(vm, ref, formReference) {
//TODO: CHILD COLLECTION MOD add error version for indexed child
let that = this;
let formControl = null;
if (formReference == undefined) {
@@ -759,7 +754,7 @@ export default {
//dev error on form?
if (!formControl) {
throw `gzform::fieldVAlueChanged formControl is not found ref:${ref}, formReferences:${formReference} `;
throw `gzform::fieldValueChanged formControl is not found ref:${ref}, formReferences:${formReference} `;
}
//this is currently required to ensure that this method runs after all the broken rule checks have settled