This commit is contained in:
2019-06-05 17:15:03 +00:00
parent f4d9220d62
commit 1ef6f6bbd9
3 changed files with 25 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
/* xeslint-disable */
/* eslint-disable */
///////////////////////////////
// gzform
//
@@ -523,6 +523,11 @@ export default {
//
//
setFormSettings(formKey, formSettings) {
store.commit("setFormSettings", formKey, formSettings);
console.log("GZFORM: committing form settings for form " + formKey);
console.log(formSettings);
store.commit("setFormSettings", {
formKey: formKey,
formSettings: formSettings
});
}
};

View File

@@ -71,7 +71,7 @@
</template>
<script>
/* Xeslint-disable */
/* eslint-disable */
const FORM_KEY = "inventorywidgetlist";
export default {
@@ -97,16 +97,19 @@ export default {
});
})
.then(() => {
//eslint-disable-next-line
debugger;
var storedFormSettings = that.$gzform.getFormSettings(FORM_KEY);
console.log("IWL:beforeCreate storedFormSettings:");
console.log(storedFormSettings);
//set default values for form settings if they are not present yet
if (!storedFormSettings) {
storedFormSettings = {
pagination: {}
};
} else {
that.localFormSettings = storedFormSettings;
}
that.localFormSettings = storedFormSettings;
that.formState.ready = true;
})
.catch(err => {
@@ -193,8 +196,8 @@ export default {
that.localFormSettings.pagination &&
that.localFormSettings.pagination.rowsPerPage
) {
//eslint-disable-next-line
debugger;
console.log("IWL: setting local formsettings as there is data:");
console.log(that.localFormSettings);
that.$gzform.setFormSettings(FORM_KEY, that.localFormSettings);
}

View File

@@ -2,7 +2,7 @@ import Vue from "vue";
import Vuex from "vuex";
import createPersistedState from "vuex-persistedstate";
import _ from "./libs/lodash.min.js";
/* eslint-disable */
const MaxLogLength = 100;
Vue.use(Vuex);
@@ -89,8 +89,14 @@ export default new Vuex.Store({
clearAllFormSettings(state) {
state.formSettings = {};
},
setFormSettings(state, formKey, data) {
state.formSettings[formKey] = data;
setFormSettings(state, data) {
console.log("STORE::setFormSettings for formkey " + data.formKey);
console.log(data.formSettings);
state.formSettings[data.formKey] = data.formSettings;
console.log("STORE::setFormSettings state.formSettings is now:");
console.log(state.formSettings);
},
clearFormSettings(state, formKey) {
delete state.formSettings[formKey];