Permalink
Browse files

small fix

  • Loading branch information...
Genki Sugawara
Genki Sugawara committed May 6, 2012
1 parent cb8877e commit 042f6b61e7424268f7ad24234cbb41a12537d27b
Showing with 12 additions and 6 deletions.
  1. +12 −6 ec2ui/content/ec2ui/deregisterlbinstances.js
@@ -53,7 +53,13 @@ var ec2ui_DeregisterInstances = {
{
registerid.push(tempArray[a]);
}
-
+
+ Instancedetails.sort(function(a, b) {
+ var name_a = (a.name || '').trim();
+ var name_b = (b.name || '').trim();
+ return (name_a < name_b) ? -1 : (name_a > name_b) ? 1 : 0;
+ });
+
for (var i in Instancedetails) {
regfound = false;
for(var a=0;a<registerid.length;a++)
@@ -78,14 +84,11 @@ var ec2ui_DeregisterInstances = {
var cellID = "cellcheck"+Idx;
var cellInstanceId = "Instanceid"+Idx;
-
+
cell1.setAttribute('type', 'checkbox');
cell1.setAttribute('id',cellID);
row.appendChild(cell1);
- cell5.setAttribute('label', Instancedetails[i].name);
- row.appendChild(cell5);
-
cell2.setAttribute('label', Instancedetails[i].id);
cell2.setAttribute('id',cellInstanceId);
row.appendChild(cell2);
@@ -95,7 +98,10 @@ var ec2ui_DeregisterInstances = {
cell4.setAttribute('label', Instancedetails[i].placement.availabilityZone);
row.appendChild(cell4);
-
+
+ cell5.setAttribute('label', Instancedetails[i].name);
+ row.appendChild(cell5);
+
var rowID = "row"+Idx;
row.setAttribute('id',rowID);
configureInstances.appendChild(row);

0 comments on commit 042f6b6

Please sign in to comment.