This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user