This commit is contained in:
2019-12-05 21:11:39 +00:00
parent f85c14e8e1
commit cb691bda68
2 changed files with 111 additions and 105 deletions

View File

@@ -40,5 +40,25 @@ export default {
resolve();
}
});
},
getFieldTemplateValue(formKey, fieldKey) {
if (fieldKey === undefined) {
throw "ERROR form-custom-template::getFieldTemplateValue -> fieldKey not specified for template for form [" +
formKey +
"]";
}
var template = window.$gz.store.state.formCustomTemplate[formKey];
if (template === undefined) {
throw "ERROR form-custom-template::getFieldTemplateValue -> Store is missing form template for [" +
formKey +
"]";
}
//_https://lodash.com/docs#find
//Note that not every field being requested will exist so it's valid to return undefined
var templateItem = window.$gz._.find(template, ["fld", fieldKey]);
return templateItem;
}
};