From f5a8eb294795cecd382e6936aca7e9421f798651 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 19 Feb 2020 00:10:18 +0000 Subject: [PATCH] --- ayanova/src/views/ay-data-list-view.vue | 33 +++++++------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/ayanova/src/views/ay-data-list-view.vue b/ayanova/src/views/ay-data-list-view.vue index 3c88d793..bcbdab32 100644 --- a/ayanova/src/views/ay-data-list-view.vue +++ b/ayanova/src/views/ay-data-list-view.vue @@ -355,8 +355,6 @@ function populateFieldDefinitions(vm) { }); } - - ////////////////////////////////////////////////////////// // // Ensures column names are present in locale table @@ -375,26 +373,6 @@ function fetchLocalizedFieldNames(vm) { }); } -// ////////////////////////////////////////////////////////// -// // -// // Ensures column names are present in locale table -// // -// function fetchLocalizedFieldNames(vm) { -// console.log("called fetchLTFN"); -// return new Promise(function fetchLFN(resolve, reject) { -// var columnKeys = []; -// for (var i = 1; i < vm.fieldDefinitions.length; i++) { -// var cm = vm.fieldDefinitions[i]; -// columnKeys.push(cm.ltKey); -// } -// //Now fetch all the keys and await the response before returning -// window.$gz.locale.fetch(columnKeys).then(() => { -// console.log("DONE fetchLTFN"); -// resolve(); -// }); -// }); -// } - ///////////////////////////////// // // @@ -431,7 +409,7 @@ function setEffectiveListView(vm) { if (res.error != undefined) { throw res.error; } else { - vm.effectiveListView = res.data; + vm.effectiveListView = JSON.parse(res.data); console.log("DONE setEffectiveListView (fetched default, lvid=0)"); } }); @@ -451,7 +429,7 @@ function setEffectiveListView(vm) { if (res.error != undefined) { throw res.error; } else { - vm.effectiveListView = res.data.listView; + vm.effectiveListView = JSON.parse(res.data.listView); console.log("DONE setEffectiveListView (fetched listView, lvid>0)"); } }); @@ -506,6 +484,7 @@ vm.fieldDefinitions //Pass 1, iterate the listview first for (var i = 0; i < vm.effectiveListView.length; i++) { var lvItem = vm.effectiveListView[i]; + var fld = window.$gz._.find(vm.fieldDefinitions, ["fieldKey", lvItem.fld]); var o = { key: fld.fieldKey, @@ -520,8 +499,14 @@ vm.fieldDefinitions sort: lvItem.sort || null, filter: lvItem.filter || null }; + ret.push(o); } + //Pass 2, remaining fields not already dealt with + vm.obj = ret; + console.log("DONE InitDataObject"); + return Promise.resolve(); + //eoc }