diff --git a/ayanova/src/components/data-table.vue b/ayanova/src/components/data-table.vue index 6d6cee07..740395a5 100644 --- a/ayanova/src/components/data-table.vue +++ b/ayanova/src/components/data-table.vue @@ -14,9 +14,6 @@ > - - {{ activeFilterId }} 0) { - // await fetchListView(vm); + // await fetchLxistView(vm); // saveFormSettings(vm); // } - // //fetch data because listview has changed + // //fetch data because lxistview has changed // vm.loading = false; await this.getDataFromApi(); }, @@ -771,7 +768,7 @@ export default { //Put back selected items vm.selected = [...preSelected]; - //persist the paging options and listview stuff so user sees same page and list on refresh or leave and return scenario + //persist the paging options and filter stuff so user sees same page and list on refresh or leave and return scenario saveFormSettings(vm); } } catch (err) { @@ -790,14 +787,15 @@ export default { //loadFormSettings(vm); vm.loading = false; vm.getDataFromApi(); - }, - beforeUpdate() { - // //WTF is beforeUpdate doing and what is resetlistview doing?? - // console.log("data-table: BEFORE UPDATE CALLED WTF?"); - // if (this.clientCriteria != null && this.activeFilterId != 0) { - // this.resetListView(); - // } } + // , + // beforeUpdate() { + // // //WTF is beforeUpdate doing and what is resetlxistview doing?? + // // console.log("data-table: BEFORE UPDATE CALLED WTF?"); + // // if (this.clientCriteria != null && this.activeFilterId != 0) { + // // this.resetLxistView(); + // // } + // } }; //Called by getDataFromApi on retrieval of list with columnData @@ -1156,90 +1154,4 @@ function loadFormSettings(vm) { } } -// //////////////////// -// // -// function untokenizeListView(lvJson) { -// //if it has one or more tokens -// //iterate the array and build a new array with substituted tokens with the correct date and time in them - -// //format of a date token filter -// //[{"fld":"widgetname"},{"fld":"widgetstartdate","filter":{"items":[{"op":"=","value":"*past90days*","token":true}]}},{"fld":"widgetenddate"}] -// if (lvJson == null) { -// return lvJson; -// } -// //See if it has any date tokens -// if (lvJson.indexOf('"token":true') == -1) { -// return lvJson; -// } - -// //we have one or more tokens, substitute them in the filter array -// let ret = []; -// let lv = JSON.parse(lvJson); - -// //iterate the incoming and copy to the outgoing directly -// //except if a date token filter then substitute our own filter object in place -// for (let ilv = 0; ilv < lv.length; ilv++) { -// //listview object -// let lvo = lv[ilv]; -// //instantiate return object -// let reto = {}; -// //copy over field name to return object -// reto.fld = lvo.fld; -// //sort? -// if (lvo.sort) { -// reto.sort = lvo.sort; -// } -// //does it have a filter? -// if (lvo.filter) { -// //yes, so copy / transform as required - -// //create an empty filter items array on return object -// reto.filter = { items: [] }; - -// //"any" property set? -// if (lvo.filter.any) { -// reto.filter.any = true; -// } - -// //iterate the filter items in the source lvo object -// for (let j = 0; j < lvo.filter.items.length; j++) { -// //get this filter item -// let fi = lvo.filter.items[j]; -// //no token shortcut -// if (!fi.token) { -// //just copy it out -// reto.filter.items.push(fi); -// } else { -// //it has a date token so let's build it out -// //filter item value contains the token, op is always equals -// let filterDates = relativeDatefilterCalculator.tokenToDates(fi.value); -// //create and add a new filter item for each not undefined value -// //{ after: undefined, before: undefined } -// //AFTER DATE? -// if (filterDates.after) { -// reto.filter.items.push({ -// op: ">", //was GreaterThanOrEqualTo but that doesn't make sense, it's only greater than was seeing wrong return data as relative date filter already adjusts for boundaries -// value: filterDates.after -// }); -// } -// //BEFORE DATE? -// if (filterDates.before) { -// reto.filter.items.push({ -// op: "<", //was LessThanOrEqualTo but see above for after ===-----^ -// value: filterDates.before -// }); -// } -// } -// } - -// //end of has filter if condition -// } - -// //push the return object into the return array -// ret.push(reto); -// //end of iterate lv loop -// } - -// return JSON.stringify(ret); -// } //[{"fld":"widgetname"},{"fld":"widgetstartdate","filter":{"items":[{"op":"=","value":"*past90days*","token":true}]}},{"fld":"widgetenddate"}]