mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 23:12:23 +00:00
* [Tables] Filtering fails when one or more cells contain undefined value #2493 * refactored to handle edge cases first
This commit is contained in:
parent
ff5b88b544
commit
2ecff75da5
@ -87,14 +87,18 @@ define(
|
||||
matchesFilters(row) {
|
||||
let doesMatchFilters = true;
|
||||
for (const key in this.columnFilters) {
|
||||
if (!this.rowHasColumn(row, key)) {
|
||||
if (!doesMatchFilters || !this.rowHasColumn(row, key)) {
|
||||
return false;
|
||||
} else {
|
||||
let formattedValue = row.getFormattedValue(key).toLowerCase();
|
||||
doesMatchFilters = doesMatchFilters &&
|
||||
formattedValue.indexOf(this.columnFilters[key]) !== -1;
|
||||
}
|
||||
|
||||
let formattedValue = row.getFormattedValue(key);
|
||||
if (formattedValue === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
doesMatchFilters = formattedValue.toLowerCase().indexOf(this.columnFilters[key]) !== -1;
|
||||
}
|
||||
|
||||
return doesMatchFilters;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user