This commit is contained in:
@@ -879,9 +879,8 @@ function loadFormSettings(vm) {
|
||||
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 && formSettings.temp.cachedListView != null) {
|
||||
console.log("loadFormSettings::using cached list view:");
|
||||
vm.listView = formSettings.temp.cachedListView;
|
||||
console.log(vm.listView);
|
||||
console.log("loadFormSettings::using cached list view:", vm.listView);
|
||||
} else {
|
||||
//fetch it and cache it
|
||||
return fetchListView(vm, vm.listViewId);
|
||||
|
||||
@@ -751,18 +751,25 @@ export default {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
//successfully updated regardless if POST or PUT so update the local cache
|
||||
//Update the formSettings now that it's saved
|
||||
var formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
formSettings.temp.cachedListView = lvSave.listView;
|
||||
formSettings.saved.dataTable.unsavedListView = null;
|
||||
formSettings.saved.dataTable.listViewId =
|
||||
res.data.id || vm.listViewId; //if res.data.id then a post, if null then a put and vm.listviewId has the id
|
||||
window.$gz.form.setFormSettings(vm.formKey, formSettings);
|
||||
|
||||
console.log(
|
||||
"aya-data-list-view::submit success, updated formsettings",
|
||||
formSettings
|
||||
);
|
||||
|
||||
//Logic for detecting if a post or put: if id then it was a post, if no id then it was a put
|
||||
// debugger;
|
||||
if (res.data.id) {
|
||||
//Handle "post" of new record (CREATE)
|
||||
|
||||
//Update the formSettings now that it's saved
|
||||
var formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
formSettings.temp.cachedListview = lvSave.listView;
|
||||
formSettings.saved.dataTable.unsavedListView = null;
|
||||
formSettings.saved.dataTable.listViewId = res.data.id;
|
||||
window.$gz.form.setFormSettings(vm.formKey, formSettings);
|
||||
|
||||
//No longer dirty
|
||||
window.$gz.form.setFormState({
|
||||
vm: vm,
|
||||
@@ -824,7 +831,7 @@ export default {
|
||||
var formSettings = window.$gz.form.getFormSettings(
|
||||
vm.formKey
|
||||
);
|
||||
formSettings.temp.cachedListview = null;
|
||||
formSettings.temp.cachedListView = null;
|
||||
formSettings.saved.dataTable.unsavedListView = null;
|
||||
formSettings.saved.dataTable.listViewId = 0;
|
||||
window.$gz.form.setFormSettings(vm.formKey, formSettings);
|
||||
@@ -865,7 +872,7 @@ export default {
|
||||
} else {
|
||||
//switch to the new record in the formsettings
|
||||
var formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
formSettings.temp.cachedListview = null;
|
||||
formSettings.temp.cachedListView = null;
|
||||
formSettings.saved.dataTable.unsavedListView = null;
|
||||
formSettings.saved.dataTable.listViewId = res.data.id;
|
||||
window.$gz.form.setFormSettings(vm.formKey, formSettings);
|
||||
|
||||
Reference in New Issue
Block a user