This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
{{ pickLists.listViews }}
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<v-select
|
||||
@@ -379,14 +380,23 @@ export default {
|
||||
},
|
||||
|
||||
listViewChanged: function() {
|
||||
//console.log("listViewchanged: TOP");
|
||||
var vm = this;
|
||||
console.log("listViewchanged: TOP b4 remove unsaved");
|
||||
console.log(vm.pickLists.listViews);
|
||||
//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;
|
||||
});
|
||||
|
||||
if (vm.listViewId == -1) {
|
||||
vm.listViewId = 0;
|
||||
}
|
||||
//
|
||||
console.log(vm.pickLists.listViews);
|
||||
console.log(vm.listViewId);
|
||||
|
||||
var ShouldGetData = vm.dataTablePagingOptions.page == 1;
|
||||
// vm.pickLists.listViews
|
||||
|
||||
if (vm.listViewId == 0) {
|
||||
//default view, no saved, no cached
|
||||
vm.listView = undefined;
|
||||
@@ -502,7 +512,7 @@ export default {
|
||||
//rehydrate last form settings
|
||||
//loadFormSettings(vm);
|
||||
vm.loading = false;
|
||||
vm.getDataFromApi(vm);
|
||||
vm.getDataFromApi();
|
||||
|
||||
//vm.getDataFromApi();
|
||||
});
|
||||
@@ -769,6 +779,7 @@ function saveFormSettings(vm) {
|
||||
//
|
||||
function loadFormSettings(vm) {
|
||||
//console.log("loadFormSettings::TOP");
|
||||
// debugger;
|
||||
var formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
//process SAVED formsettings
|
||||
if (formSettings.saved) {
|
||||
@@ -813,11 +824,8 @@ function loadFormSettings(vm) {
|
||||
//check for cached local copy of saved list view in use
|
||||
if (vm.listViewId > 0) {
|
||||
//0=no list view, -1=unsaved list view so any number greater than zero means there sb a cached local copy of a saved list view
|
||||
if (
|
||||
formSettings.temp.dataTable &&
|
||||
formSettings.temp.dataTable.cachedListView != null
|
||||
) {
|
||||
vm.listView = formSettings.temp.dataTable.cachedListView;
|
||||
if (formSettings.temp && formSettings.temp.cachedListView != null) {
|
||||
vm.listView = formSettings.temp.cachedListView;
|
||||
} else {
|
||||
//fetch it and cache it
|
||||
return fetchListView(vm, vm.listViewId);
|
||||
|
||||
Reference in New Issue
Block a user