improve sorting of values in filter-view.
Instead of only sorting plain numbers we also sort Strings now,
e.g. to have a deterministic position for status-values or machine-names.
@@ -943,11 +943,11 @@ function fillRowFilterField(columnIndex) {
options.sort( function(a, b) {
if (a == null) return 1;
if (b == null) return -1;
- if (a.endsWith('s')) a = a.substring(0,a.length-1);
- if (b.endsWith('s')) b = b.substring(0,b.length-1);
- if (isNaN(a)) return 1;
- if (isNaN(b)) return -1;
- return a - b;
+ if (a.endsWith('s') && b.endsWith('s')) {
+ a = a.substring(0,a.length-1);
+ b = b.substring(0,b.length-1);
+ }
+ return a.localeCompare(b, undefined, {numeric: true});
} );
// delete old elements
