← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3854: fixes selection bug when saving/updating a chart

 

------------------------------------------------------------
revno: 3854
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-06-08 10:38:45 +0200
message:
  fixes selection bug when saving/updating a chart
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.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-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js	2011-06-07 16:12:23 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js	2011-06-08 08:38:45 +0000
@@ -71,10 +71,26 @@
         return false;
     } else if (type == "success")
     {
-        $("#selectedIndicators").children().attr("selected", true);
-        $("#selectedDataElements").children().attr("selected", true);
-        $("#selectedPeriods").children().attr("selected", true);
-        $("#selectedOrganisationUnits").children().attr("selected", true);
+        if ($("#selectedIndicators").attr('multiple') !== undefined)
+        {
+            $("#selectedIndicators").children().attr("selected", true);
+        }
+
+        if ($("#selectedDataElements").attr('multiple') !== undefined)
+        {
+            $("#selectedDataElements").children().attr("selected", true);
+        }
+
+        if ($("#selectedPeriods").attr('multiple') !== undefined)
+        {
+            $("#selectedPeriods").children().attr("selected", true);
+        }
+
+        if ($("#selectedOrganisationUnits").attr('multiple') !== undefined)
+        {
+            $("#selectedOrganisationUnits").children().attr("selected", true);
+        }
+
         $('#chartForm').submit();
     }
 }