Put selected columns into nextmatch value so columns are saved in favourites

This commit is contained in:
nathangray 2021-03-22 11:09:41 -06:00
parent b5f45f1e71
commit afd2364979
2 changed files with 12 additions and 2 deletions

View File

@ -1101,7 +1101,7 @@ var et2_nextmatch = /** @class */ (function (_super) {
jQuery.merge(colDisplay, custom_fields); jQuery.merge(colDisplay, custom_fields);
// Update query value, so data source can use visible columns to exclude expensive sub-queries // Update query value, so data source can use visible columns to exclude expensive sub-queries
var oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : []; var oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : [];
this.activeFilters.selectcols = this.sortedColumnsList ? this.sortedColumnsList : colDisplay; this.activeFilters.selectcols = this.sortedColumnsList.length > 0 ? this.sortedColumnsList : colDisplay;
// We don't need to re-query if they've removed a column // We don't need to re-query if they've removed a column
var changed = []; var changed = [];
ColLoop: for (var i = 0; i < colDisplay.length; i++) { ColLoop: for (var i = 0; i < colDisplay.length; i++) {
@ -2016,6 +2016,10 @@ var et2_nextmatch = /** @class */ (function (_super) {
"selected": idsArr "selected": idsArr
}; };
jQuery.extend(value, this.activeFilters, this.value); jQuery.extend(value, this.activeFilters, this.value);
if (typeof value.selectcols == "undefined" || value.selectcols.length === 0) {
this._updateUserPreferences();
value.selectcols = this.activeFilters.selectcols;
}
return value; return value;
}; };
et2_nextmatch.prototype.resetDirty = function () { }; et2_nextmatch.prototype.resetDirty = function () { };

View File

@ -1526,7 +1526,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
// Update query value, so data source can use visible columns to exclude expensive sub-queries // Update query value, so data source can use visible columns to exclude expensive sub-queries
const oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : []; const oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : [];
this.activeFilters.selectcols = this.sortedColumnsList ? this.sortedColumnsList : colDisplay; this.activeFilters.selectcols = this.sortedColumnsList.length > 0 ? this.sortedColumnsList : colDisplay;
// We don't need to re-query if they've removed a column // We don't need to re-query if they've removed a column
const changed = []; const changed = [];
@ -2714,6 +2714,12 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
"selected": idsArr "selected": idsArr
}; };
jQuery.extend(value, this.activeFilters, this.value); jQuery.extend(value, this.activeFilters, this.value);
if(typeof value.selectcols == "undefined" || value.selectcols.length === 0)
{
this._updateUserPreferences();
value.selectcols = this.activeFilters.selectcols;
}
return value; return value;
} }
resetDirty( ) resetDirty( )