← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7188: (patient) Move up/down buttons don’t work in program-stage.

 

------------------------------------------------------------
revno: 7188
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-06-05 14:04:35 +0700
message:
  (patient) Move up/down buttons don’t work in program-stage.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js	2012-06-05 06:46:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js	2012-06-05 07:04:35 +0000
@@ -136,9 +136,14 @@
 function moveDownDataElement()
 {
 	var selectedList = jQuery("#selectedList");
-
+	var items = new Array();
 	jQuery("#selectedList").find("tr").each( function( i, item ){
-		item = jQuery(item);
+		items.push(jQuery(item));
+	});
+	
+	for( var i=items.length-1;i>=0;i--)
+	{	
+		var item = items[i];
 		if( item.hasClass("selected") )
 		{
 			var next = item.next('#selectedList tr');
@@ -147,7 +152,7 @@
 				next.after(item);
 			}
 		}
-	});
+	}
 }
 
 function unSelectDataElement( element )