This commit is contained in:
2020-02-19 00:10:18 +00:00
parent 4231675e25
commit f5a8eb2947

View File

@@ -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
}