← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5012: Custom form editor, made it possible to insert greyed / disabled input fields

 

------------------------------------------------------------
revno: 5012
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2011-10-23 21:14:09 +0200
message:
  Custom form editor, made it possible to insert greyed / disabled input fields
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm


--
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/resources/org/hisp/dhis/dataset/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2011-10-23 18:51:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2011-10-23 19:14:09 +0000
@@ -137,4 +137,5 @@
 select_org_unit												= Select organisation unit
 assigned													= Assigned
 unassigned													= Unassigned
-show_selection_box											= Show selection box
\ No newline at end of file
+show_selection_box											= Show selection box
+greyed_field												= Greyed field
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js	2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js	2011-10-23 19:14:09 +0000
@@ -201,6 +201,8 @@
 		var dataEntryId = dataElementId + "-" + optionComboId + "-val";
 	
 		var html = "";
+		
+		var greyedField = $( "#greyedField" ).is( ":checked" ) ? " disabled=\"disabled\"" : "";
 	
 		if (dataElementType == "bool") {
 			html = "<input title=\"" + titleValue
@@ -210,7 +212,7 @@
 		else {
 			html = "<input title=\"" + titleValue
 					+ "\" value=\"" + displayName + "\" id=\"" + dataEntryId
-					+ "\" style=\"width:7em;text-align:center\"/>";
+					+ "\" style=\"width:7em;text-align:center\"" + greyedField + "/>";
 		}
 	
 		if (!checkExisted(dataEntryId)) {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm	2011-10-23 18:51:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm	2011-10-23 19:14:09 +0000
@@ -156,18 +156,17 @@
 					<select id="dataElementSelector" multiple="multiple" style="height: 200px; width: 100%;"></select>
 				</td>
 			</tr>
-
 			<tr id="indicatorsTab">
 				<td colspan="2">
 					<select id="indicatorSelector" multiple="multiple" style="height: 200px; width: 100%;"></select>
 				</td>
 			</tr>
-
 			<tr>
 				<td>
 					<button type="button" id="dataElementsButton">$i18n.getString( "data_elements" )</button>
 					<button type="button" id="indicatorsButton">$i18n.getString( "indicators" )</button>&nbsp;&nbsp;<span style="color:#606060">|</span>&nbsp;
 					<button type="button" id="insertButton">$i18n.getString( "insert" )</button>
+					<input type="checkbox" id="greyedField"><label for="greyedField">$i18n.getString( "greyed_field" )</label>
 				</td>
 				<td style="width: 190px;">
 					<span id="message_"></span>