mirror of https://github.com/apache/cloudstack.git
metrics: don't sort on columns where all elements are same
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
c02dc40dd9
commit
ca42ed29b8
|
|
@ -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());
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue