← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2402: Re-added the missing method in commons.js and lists.js

 

------------------------------------------------------------
revno: 2402
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-10-21 14:29:06 +0700
message:
  Re-added the missing method in commons.js and lists.js
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2010-10-20 09:27:52 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2010-10-21 07:29:06 +0000
@@ -1295,3 +1295,13 @@
 		arrows: true
 	});
 }
+
+/**
+ * Used to export PDF file by the given type and
+ * the active items in table
+ */
+function exportPdfByType( type )
+{
+	var activeIds = getArrayIdOfActiveRows();
+	window.location.href = 'exportToPdf.action?type=' + type + activeIds;
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js	2010-10-20 09:27:52 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js	2010-10-21 07:29:06 +0000
@@ -446,4 +446,20 @@
 	});
 	
 	return result;
+}
+
+/**
+ * Return the list of Id from the active rows in table name 'listTable'
+ */
+function getArrayIdOfActiveRows()
+{
+	var params = "";
+	var rows = jQuery( "table.listTable tbody tr" );
+
+	for ( var i = 0; i < rows.length; i++ )
+	{
+		params += "&activeIds=" + rows[i].id.split("tr")[1];
+	}
+
+	return params;
 }
\ No newline at end of file