dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17315
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6841: (patient) Donnot validate value of optionset-dataelement.
------------------------------------------------------------
revno: 6841
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-05-03 16:06:08 +0700
message:
(patient) Donnot validate value of optionset-dataelement.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.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-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-05-03 07:59:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-05-03 09:06:08 +0000
@@ -150,7 +150,7 @@
}
//------------------------------------------------------------------------------
-//Save value
+// Save value
//------------------------------------------------------------------------------
function saveVal( dataElementId )
@@ -161,13 +161,18 @@
var field = byId( fieldId );
var fieldValue = jQuery.trim( field.value );
- var data = jQuery( "#" + fieldId ).metadata({
- type:'attr',
- name:'data'
- });
-
- var dataElementName = data.deName;
- var type = data.deType;
+ var arrData = jQuery( "#" + fieldId ).attr('data').replace('{','').replace('}','').replace(/'/g,"").split(',');
+ var data = new Array();
+ for( var i in arrData )
+ {
+ var values = arrData[i].split(':');
+ var key = jQuery.trim( values[0] );
+ var value = jQuery.trim( values[1] )
+ data[key] = value;
+ }
+
+ var dataElementName = data['deName'];
+ var type = data['deType'];
field.style.backgroundColor = '#ffffcc';