← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6085: Js fix

 

------------------------------------------------------------
revno: 6085
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-22 19:30:30 +0100
message:
  Js fix
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.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-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js	2011-09-27 09:10:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js	2012-02-22 18:30:30 +0000
@@ -14,12 +14,15 @@
 	});
 }
 
-function sortOrderSubmit() {
+function sortOrderSubmit() 
+{
 	var datasetId = document.getElementById('dataSetId').value;
 
-	if( datasetId == "null" ) {
+	if ( datasetId == "null" ) 
+	{
 		window.alert( i18n_please_select_dataset );
-	} else {
+	} else 
+	{
 		window.location.href = "showSortSectionForm.action?dataSetId=" + datasetId;
 	}
 }
@@ -49,19 +52,24 @@
 	}
 }
 
-function toggle(dataElementId, optionComboId) {
+function toggle( dataElementId, optionComboId ) 
+{
 	var elementId = '[' + dataElementId;
 
-	if (optionComboId != '') {
+	if (optionComboId != '') 
+	{
 		elementId = elementId + ']_[' + optionComboId;
 	}
 
 	elementId = elementId + ']';
 
-	if (document.getElementById(elementId + '.text').disabled == true) {
+	if (document.getElementById(elementId + '.text').disabled == true) 
+	{
 		document.getElementById(elementId + '.text').disabled = false;
 		document.getElementById(elementId + '.button').value = i18n_disable;
-	} else {
+	} 
+	else 
+	{
 		document.getElementById(elementId + '.text').disabled = true;
 		document.getElementById(elementId + '.button').value = i18n_enable;
 	}
@@ -89,7 +97,7 @@
 	var txtElementId = elementId + '.txt';
 	var btnElementId = elementId + '.btn';
 
-	if (document.getElementById( txtElementId ).disabled == true) 
+	if ( document.getElementById( txtElementId ).disabled == true ) 
 	{
 		document.getElementById( txtElementId ).disabled = false;
 		document.getElementById( btnElementId ).value = i18n_disable;
@@ -104,23 +112,9 @@
 		isGreyed = true;
 	}
 	
-	var request = new Request();
-	request.setCallbackSuccess(handleResponse);
-	request.setCallbackError(handleHttpError);
-	request.setResponseTypeXML('status');
+	// TODO check result
 	
-	var requestString = 'saveSectionGreyStatus.action?sectionId=' + sectionId
-			+ '&dataElementId=' + dataElementId + '&optionComboId='
-			+ optionComboId + '&isGreyed=' + isGreyed;
-
-	request.send(requestString);
-}
-
-function handleResponse(rootElement) {
-}
-
-function handleHttpError(errorCode) {
-}
-
-function markValue(color) {
+	$.get( 'saveSectionGreyStatus.action',
+		{ sectionId:sectionId, dataElementId:dataElementId, optionComboId:optionComboId, isGreyed:isGreyed }, 
+		function() {} );
 }