From 1634dd4533726fe4812d546bdf34861bdcae7409 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 29 Oct 2015 13:13:37 +0530 Subject: [PATCH] metrics: fix sorting regression in case of state columns Signed-off-by: Rohit Yadav --- ui/scripts/ui/widgets/dataTable.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/scripts/ui/widgets/dataTable.js b/ui/scripts/ui/widgets/dataTable.js index e89e72b0178..16509389b56 100644 --- a/ui/scripts/ui/widgets/dataTable.js +++ b/ui/scripts/ui/widgets/dataTable.js @@ -166,9 +166,6 @@ sortData.push($(this)); }); - if (hasAllRowsSameValue) { - return; - } var stringComparator = function(a,b) { return a.html().localeCompare(b.html()); @@ -186,8 +183,13 @@ var comparator = stringComparator; if ($($elems[0]).hasClass('state')) { comparator = stateComparator; - } else if (columnIndex != 0 && isNumeric($($elems[0]).children().html())) { - comparator = numericComparator; + } else { + if (hasAllRowsSameValue) { + return; + } + if (columnIndex != 0 && isNumeric($($elems[0]).children().html())) { + comparator = numericComparator; + } } sortData.sort(comparator);