This commit is contained in:
@@ -97,15 +97,31 @@ export default {
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
var storedFormSettings = that.$gzform.getFormSettings(FORM_KEY);
|
||||
|
||||
var formSettings = that.$gzform.getFormSettings(FORM_KEY);
|
||||
/**
|
||||
* {
|
||||
temp: { page: that.localFormSettings.pagination.page },
|
||||
saved: {
|
||||
rowsPerPage: that.localFormSettings.pagination.rowsPerPage,
|
||||
sortBy: that.localFormSettings.pagination.sortBy,
|
||||
descending: that.localFormSettings.pagination.descending
|
||||
}
|
||||
}
|
||||
*/
|
||||
//set default values for form settings if they are not present yet
|
||||
if (!storedFormSettings) {
|
||||
storedFormSettings = {
|
||||
if (!formSettings.saved || !formSettings.saved.rowsPerPage) {
|
||||
that.localFormSettings = {
|
||||
pagination: {}
|
||||
};
|
||||
} else {
|
||||
that.localFormSettings = storedFormSettings;
|
||||
that.localFormSettings.pagination = {
|
||||
rowsPerPage: formSettings.saved.rowsPerPage,
|
||||
sortBy: formSettings.saved.sortBy,
|
||||
descending: formSettings.saved.descending
|
||||
};
|
||||
if (formSettings.temp && formSettings.temp.page) {
|
||||
that.localFormSettings.pagination.page = formSettings.temp.page;
|
||||
}
|
||||
}
|
||||
|
||||
that.formState.ready = true;
|
||||
@@ -192,7 +208,14 @@ export default {
|
||||
that.localFormSettings.pagination &&
|
||||
that.localFormSettings.pagination.rowsPerPage
|
||||
) {
|
||||
that.$gzform.setFormSettings(FORM_KEY, that.localFormSettings);
|
||||
that.$gzform.setFormSettings(FORM_KEY, {
|
||||
temp: { page: that.localFormSettings.pagination.page },
|
||||
saved: {
|
||||
rowsPerPage: that.localFormSettings.pagination.rowsPerPage,
|
||||
sortBy: that.localFormSettings.pagination.sortBy,
|
||||
descending: that.localFormSettings.pagination.descending
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
|
||||
Reference in New Issue
Block a user