From 63dc693201173f4e1058ca5efa6d1ecc66091931 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 19 Feb 2020 15:54:16 +0000 Subject: [PATCH] --- ayanova/src/api/locale.js | 3 ++- ayanova/src/components/gz-data-table.vue | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index a04035da..14e0a30d 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -157,7 +157,8 @@ export default { "Loading", "AM", "PM", - "DataListView" + "DataListView", + "FilterUnsaved" ], //////////////////////////////////////////////////////// diff --git a/ayanova/src/components/gz-data-table.vue b/ayanova/src/components/gz-data-table.vue index c664d475..24c09118 100644 --- a/ayanova/src/components/gz-data-table.vue +++ b/ayanova/src/components/gz-data-table.vue @@ -381,11 +381,12 @@ export default { listViewChanged: function() { //console.log("listViewchanged: TOP"); var vm = this; - //find out if we need to trigger the get data or if it will happen automatically - //when we set page to 0 - //console.log(vm.dataTablePagingOptions.page); + //If listview had changed it can only have changed *away* from the unsaved filter item if it's present so just remove that if it exists + window.$gz._.remove(vm.pickLists.listViews, function(n) { + return n.id == -1; + }); var ShouldGetData = vm.dataTablePagingOptions.page == 1; - + // vm.pickLists.listViews if (vm.listViewId == 0) { //default view, no saved, no cached vm.listView = undefined; @@ -680,7 +681,13 @@ function populatePickLists(vm) { } else { vm.pickLists.listViews = res.data; window.$gz.form.addNoSelectionItem(vm.pickLists.listViews); - //vm.pickLists.availableDataListViews.unshift({ name: "-", id: 0 }); + //add UNSAVED FILTER if -1 + if (vm.listViewId == -1) { + vm.pickLists.listViews.unshift({ + name: vm.lt("FilterUnsaved"), + id: -1 + }); + } } }); }