This commit is contained in:
2020-06-19 23:08:47 +00:00
parent 160d84d954
commit 606f91092f
2 changed files with 41 additions and 48 deletions

View File

@@ -548,16 +548,14 @@ export default {
}
}
},
created() {
async created() {
//get pick lists
let vm = this;
initForm(vm).then(() => {
//rehydrate last form settings
//loadFormSettings(vm);
vm.loading = false;
vm.getDataFromApi();
});
await initForm(vm);
//rehydrate last form settings
//loadFormSettings(vm);
vm.loading = false;
vm.getDataFromApi();
}
};
@@ -724,10 +722,8 @@ async function fetchTranslatedHeaderNames(columnData) {
let cm = columnData[i];
headerKeys.push(cm.cm);
}
//Now fetch all the keys and await the response before returning
await window.$gz.translation.cacheTranslations(headerKeys).then(() => {
return;
});
//Now fetch all the keys
await window.$gz.translation.cacheTranslations(headerKeys);
}
//////////////////////////////////////////////////////////
@@ -766,35 +762,33 @@ function initForm(vm) {
////////////////////
//
function populateSelectionLists(vm) {
async function populateSelectionLists(vm) {
//http://localhost:7575/api/v8/data-list-view/viewlist?ListKey=TestWidgetDataList
return window.$gz.api
.get("data-list-view/viewlist?ListKey=" + vm.dataListKey)
.then(res => {
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error, vm);
} else {
vm.selectLists.listViews = res.data;
window.$gz.form.addNoSelectionItem(vm.selectLists.listViews);
}
});
let res = await window.$gz.api.get(
"data-list-view/viewlist?ListKey=" + vm.dataListKey
);
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error, vm);
} else {
vm.selectLists.listViews = res.data;
window.$gz.form.addNoSelectionItem(vm.selectLists.listViews);
}
}
//////////////////////////////////////////////////////////
//
// Fetch and cache list view
//
function fetchListView(vm) {
async function fetchListView(vm) {
if (!vm.listViewId) {
return;
}
return window.$gz.api.get("data-list-view/" + vm.listViewId).then(res => {
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error, vm);
} else {
vm.listView = res.data.listView;
}
});
let res = await window.$gz.api.get("data-list-view/" + vm.listViewId);
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error, vm);
} else {
vm.listView = res.data.listView;
}
}
////////////////////