diff --git a/openbis_ng_ui/src/js/components/common/grid/GridController.js b/openbis_ng_ui/src/js/components/common/grid/GridController.js index d50663e8ada3aca2ca253d4695027761e3db632d..5acf40f0ded9380e5ffe77d26d4491c97cf15e74 100644 --- a/openbis_ng_ui/src/js/components/common/grid/GridController.js +++ b/openbis_ng_ui/src/js/components/common/grid/GridController.js @@ -338,13 +338,17 @@ export default class GridController { _sort(rows, columns, sort, sortDirection) { if (sort) { - let column = _.find(columns, ['field', sort]) + const column = _.find(columns, ['field', sort]) if (column) { + const collator = new Intl.Collator(undefined, { + numeric: true, + sensitivity: 'base' + }) return rows.sort((t1, t2) => { let sign = sortDirection === 'asc' ? 1 : -1 let v1 = this._getValue(t1, column.field) let v2 = this._getValue(t2, column.field) - return sign * v1.localeCompare(v2) + return sign * collator.compare(v1, v2) }) } }