diff --git a/ui/scripts/ui/widgets/dataTable.js b/ui/scripts/ui/widgets/dataTable.js index c85f2d26737..e89e72b0178 100644 --- a/ui/scripts/ui/widgets/dataTable.js +++ b/ui/scripts/ui/widgets/dataTable.js @@ -154,11 +154,22 @@ return $(this).index() == columnIndex; }); + var hasAllRowsSameValue = true; + var firstElem = $($elems[0]).html(); var sortData = []; $elems.each(function() { + if (hasAllRowsSameValue) { + if (firstElem !== $(this).html()) { + hasAllRowsSameValue = false; + } + } sortData.push($(this)); }); + if (hasAllRowsSameValue) { + return; + } + var stringComparator = function(a,b) { return a.html().localeCompare(b.html()); };