This commit is contained in:
@@ -5,6 +5,25 @@ export default {
|
||||
enumKey = enumKey.toLowerCase();
|
||||
return window.$gz.store.state.enums[enumKey][enumValue];
|
||||
},
|
||||
//////////////////////////////////
|
||||
//
|
||||
// Used by forms to fetch picklist data
|
||||
//
|
||||
getPickList(enumKey) {
|
||||
enumKey = enumKey.toLowerCase();
|
||||
var e = window.$gz.store.state.enums[enumKey];
|
||||
if (!e) {
|
||||
throw "ERROR enums::getPickList -> enumKey " +
|
||||
enumKey +
|
||||
" is missing from store";
|
||||
}
|
||||
var ret = [];
|
||||
//turn it into an array suitable for picklists
|
||||
window.$gz._.forOwn(e, function(value, key) {
|
||||
ret.push({ id: Number(key), name: value });
|
||||
});
|
||||
return ret;
|
||||
},
|
||||
///////////////////////////////////
|
||||
//
|
||||
// Fetches enum list from server
|
||||
|
||||
Reference in New Issue
Block a user