For push update filter, consider empty array as having no value

This commit is contained in:
nathangray 2021-02-25 13:59:32 -07:00
parent 12c315abbc
commit 1eb174d3f7
2 changed files with 19 additions and 18 deletions

View File

@ -243,15 +243,15 @@ var EgwApp = /** @class */ (function () {
};
}
// Get current filter values
if (this.et2) {
var value = nm.getValue();
if (!value || !value.col_filter)
return false;
for (var _i = 0, _a = Object.values(filters); _i < _a.length; _i++) {
var field_filter = _a[_i];
if (value.col_filter[field_filter.col]) {
field_filter.filter_values.push(value.col_filter[field_filter.col]);
}
var val = value.col_filter[field_filter.col];
if (val && (typeof val == "string" && val.trim().length > 0 ||
typeof val == "object" && !jQuery.isEmptyObject(val))) {
field_filter.filter_values.push(val);
}
}
var _loop_2 = function (field_filter) {

View File

@ -373,17 +373,18 @@ export abstract class EgwApp
}
// Get current filter values
if(this.et2)
{
let value = nm.getValue();
if(!value || !value.col_filter) return false;
for(let field_filter of Object.values(filters))
{
if(value.col_filter[field_filter.col])
let val = value.col_filter[field_filter.col];
if(val && (
typeof val == "string" && val.trim().length > 0 ||
typeof val == "object" && !jQuery.isEmptyObject(val)
))
{
field_filter.filter_values.push(value.col_filter[field_filter.col]);
}
field_filter.filter_values.push(val);
}
}