dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13337
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4251: Impl highlighting of current data element in data entry
Merge authors:
Lars Helge Øverland (larshelge)
------------------------------------------------------------
revno: 4251 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-08-03 11:08:58 +0200
message:
Impl highlighting of current data element in data entry
modified:
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/GetChartAction.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css
--
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-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/GetChartAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/GetChartAction.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/GetChartAction.java 2011-08-03 09:08:58 +0000
@@ -105,7 +105,7 @@
}
// -------------------------------------------------------------------------
- // Action implemenation
+ // Action implementation
// -------------------------------------------------------------------------
public String execute()
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-07-21 20:27:34 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-08-02 18:48:02 +0000
@@ -1,6 +1,6 @@
#set( $tabIndex = 1 )
#foreach( $categoryCombo in $orderedCategoryCombos )
-<table style="border:1px solid #c0c0c0; padding:10px;">
+<table style="border:1px solid #c0c0c0; padding:10px;" cellspacing="0">
#set( $colCount = $numberOfTotalColumns.get( $categoryCombo.id ) )
#set( $categories = $orderedCategories.get( $categoryCombo.id ) )
#set( $optionsMap = $orderedOptionsMap.get( $categoryCombo.id ) )
@@ -34,7 +34,7 @@
#end
#set( $count = $count + 1 )
<tr>
- <td #if( $mark == 1 )class="altRow"#else class="regRow"#end><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
+ <td id="${dataElement.id}-cell" #if( $mark == 1 )class="altRow"#else class="regRow"#end><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
#foreach( $optionCombo in $optionCombos )
#set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" )
<td>
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2011-07-21 18:20:49 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2011-08-02 18:48:02 +0000
@@ -7,6 +7,7 @@
* {dataelementid}-{optioncomboid}-val // data value
* {dataelementid}-dataelement // name of data element
* {optioncomboid}-optioncombo // name of category option combo
+ * {dataelementid}-cell // table cell for data element name
* {dataelementid}-{optioncomboid}-min // min value for data value
* {dataelementid}-{optioncomboid}-max // max value for data value
*/
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2011-07-28 09:34:27 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2011-08-02 18:48:02 +0000
@@ -51,6 +51,8 @@
$( this ).focus( valueFocus );
+ $( this ).blur( valueBlur );
+
$( this ).change( function() {
saveVal( dataElementId, optionComboId );
} );
@@ -402,12 +404,23 @@
var dataElementName = dataElements[dataElementId].name;
var optionComboName = $( '#' + optionComboId + '-optioncombo' ).text();
- $( "#currentDataElement" ).html( dataElementName + ' ' + optionComboName );
+ $( '#currentDataElement' ).html( dataElementName + ' ' + optionComboName );
+
+ $( '#' + dataElementId + '-cell' ).addClass( 'currentRow' );
+}
+
+function valueBlur( e )
+{
+ var id = e.target.id;
+
+ var dataElementId = id.split( '-' )[0];
+
+ $( '#' + dataElementId + '-cell' ).removeClass( 'currentRow' );
}
function keyPress( event, field )
{
- var key = event.keyCode || event.charCode || event.which;
+ var key = event.keyCoe || event.charCode || event.which;
var focusField = ( key == 13 || key == 40 ) ? getNextEntryField( field )
: ( key == 38 ) ? getPreviousEntryField( field ) : false;
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2011-07-21 20:27:34 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2011-08-02 18:48:02 +0000
@@ -18,7 +18,7 @@
<tr>
<td>
<div>
- <table cellpadding="0">
+ <table cellspacing="0">
#set( $categoryComboId = $sectionCombos.get( $section.id ) )
#set( $colCount = $numberOfTotalColumns.get( $categoryComboId ) )
#set( $categories = $orderedCategories.get( $categoryComboId ) )
@@ -52,7 +52,7 @@
#end
#set( $count = $count + 1 )
<tr>
- <td #if( $mark == 1 )class="altRow"#else class="regRow"#end><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
+ <td id="${dataElement.id}-cell" #if( $mark == 1 )class="altRow"#else class="regRow"#end><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
#foreach( $optionCombo in $optionCombos )
#set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" )
#set( $greyedField = false )
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css 2011-07-28 07:15:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css 2011-08-02 18:48:02 +0000
@@ -3,7 +3,7 @@
{
color: black;
padding: 6px;
- background-color: #D5FFC5;
+ background-color: #d5ffc5;
border: 1px solid black;
font-size: 14px;
text-align: right;
@@ -49,6 +49,12 @@
padding-right: 50px;
}
+.currentRow
+{
+ background-color: #d5ffc5;
+ padding-right: 50px;
+}
+
.cent
{
text-align: center;