This commit is contained in:
@@ -798,6 +798,16 @@ export default {
|
||||
//workaround to prevent warning about leaving dirty record
|
||||
//For some reason I couldn't just reset isdirty in formstate
|
||||
JUST_DELETED = true;
|
||||
|
||||
//set it to the default list view so the caller doesn't try to load the non-existant deleted view it was just working with
|
||||
var formSettings = window.$gz.form.getFormSettings(
|
||||
vm.formKey
|
||||
);
|
||||
formSettings.temp.cachedListview = null;
|
||||
formSettings.saved.dataTable.unsavedListView = null;
|
||||
formSettings.saved.dataTable.listViewId = 0;
|
||||
window.$gz.form.setFormSettings(vm.formKey, formSettings);
|
||||
|
||||
// navigate backwards
|
||||
vm.$router.go(-1);
|
||||
}
|
||||
@@ -832,7 +842,19 @@ export default {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
//switch to the new record in the formsettings
|
||||
var formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
formSettings.temp.cachedListview = null;
|
||||
formSettings.saved.dataTable.unsavedListView = null;
|
||||
formSettings.saved.dataTable.listViewId = res.data.id;
|
||||
window.$gz.form.setFormSettings(vm.formKey, formSettings);
|
||||
|
||||
//Set some values that otherwise don't get updated because we're not really navigating fresh
|
||||
vm.obj.name = res.data.name;
|
||||
vm.obj.concurrencyToken = res.data.concurrencyToken;
|
||||
vm.obj.listViewId = res.data.id;
|
||||
//Navigate to new record
|
||||
//NOTE: this doesn't really update the form at all so need to set some th9ings
|
||||
vm.$router.push(
|
||||
vm.$route.fullPath.slice(0, -1) + res.data.id
|
||||
// window.$gz.api.replaceAfterLastSlash(
|
||||
|
||||
Reference in New Issue
Block a user