← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19411: tracker-capture: improved UI for optionset

 

------------------------------------------------------------
revno: 19411
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-06-15 17:29:59 +0200
message:
  tracker-capture: improved UI for optionset
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/select2.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.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-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-06-14 13:07:10 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-06-15 15:29:59 +0000
@@ -693,7 +693,7 @@
             
     };
     
-    $scope.getInputNotifcationClass = function(id, custom, event){
+    /*$scope.getInputNotifcationClass = function(id, custom, event){
         if(!event) {
             event = $scope.currentEvent;
         }
@@ -716,6 +716,33 @@
             return '';
         }
         return 'form-control';
+    };*/
+            
+    //Infinite Scroll
+    $scope.infiniteScroll = {};
+    $scope.infiniteScroll.optionsToAdd = 20;
+    $scope.infiniteScroll.currentOptions = 20;
+    
+    $scope.resetInfScroll = function() {
+        $scope.infiniteScroll.currentOptions = $scope.infiniteScroll.optionsToAdd;
+    };
+  
+    $scope.addMoreOptions = function(){
+        $scope.infiniteScroll.currentOptions += $scope.infiniteScroll.optionsToAdd;
+    };        
+    
+    $scope.getInputNotifcationClass = function(id, custom, event){
+        if(!event) {
+            event = $scope.currentEvent;
+        }
+        if($scope.currentElement.id && 
+                $scope.currentElement.event && 
+                $scope.currentElement.id === id &&
+                $scope.currentElement.event === event.event){            
+            return $scope.currentElement.saved ? 'input-success; ' : 'input-error; ';                      
+        }  
+        
+        return '';
     };
     
     var completeEnrollment = function(){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-06-10 11:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-06-15 15:29:59 +0000
@@ -149,7 +149,7 @@
 
                 <!-- data entry form begins -->
                 <div ng-if="currentEvent.eventDate">                            
-                    <div class="clear vertical-spacing" ng-if="displayCustomForm === 'custom'" ng-include="'../dhis-web-commons/customform/custom-form.html'"></div>  
+                    <div class="clear vertical-spacing" ng-if="displayCustomForm === 'custom'" ng-include="'../dhis-web-commons/angular-forms/custom-form.html'"></div>  
                     <div class="clear vertical-spacing" ng-if="displayCustomForm === 'default'" ng-include="'components/dataentry/default-form.html'"></div>
                 </div>    
                 <!-- the table form is insensitive to the event date being present. In this situation the eventdate is set inside the table form -->

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html	2015-06-14 09:28:40 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html	2015-06-15 15:29:59 +0000
@@ -26,23 +26,26 @@
                 <ng-form name="innerForm">
                     <div ng-if="prStDe.dataElement.optionSetValue">
                         <div ng-if="!selectedProgram.dataEntryMethod || optionSets[prStDe.dataElement.optionSet.id].options.length >= 7">
-                            <input type="text"
-                                ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
-                                ng-model="currentEvent[prStDe.dataElement.id]" 
-                                class="typeahead"
-                                placeholder="&#xf0d7;&nbsp;&nbsp;"
-                                ng-required={{prStDe.compulsory}} 
-                                ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
-                                typeahead="option.name as option.name for option in optionSets[prStDe.dataElement.optionSet.id].options | filter:$viewValue | limitTo:20"                                 
-                                typeahead-focus-first="false"
-                                typeahead-editable="false"
-                                ng-blur="saveDatavalue(prStDe, innerForm.foo)" 
-                                name="foo"/>
+                            <ui-select  ng-model="currentEvent[prStDe.dataElement.id]" 
+                                        theme="select2" 
+                                        ng-required={{prStDe.compulsory}} 
+                                        ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
+                                        name="foo" 
+                                        on-select="saveDatavalue(prStDe, innerForm.foo)" 
+                                        style="width:100%;">
+                                <ui-select-match allow-clear="true" ng-class={{getInputNotifcationClass(prStDe.dataElement.id,false)}} style="width:100%; height:34px; line-height:1.0; padding: 2px 6px; margin-top:5px" placeholder="{{'select_or_search' | translate}}">{{$select.selected.name  || $select.selected}}</ui-select-match>
+                                <ui-select-choices  infinite-scroll="addMoreOptions()"
+                                                    infinite-scroll-distance="2"
+                                                    repeat="option.name as option in optionSets[prStDe.dataElement.optionSet.id].options | filter: $select.search | limitTo:20">
+                                  <span ng-bind-html="option.name | highlight: $select.search"></span>
+                                </ui-select-choices>
+                            </ui-select>
                         </div>
                         <div ng-if="selectedProgram.dataEntryMethod && optionSets[prStDe.dataElement.optionSet.id].options.length < 7">
                             <label>                                        
                                 <input type="radio"
                                     ng-class='getInputNotifcationClass(prStDe.dataElement.id,true)'
+                                    class="form-control"
                                     name={{prStDe.dataElement.id}}
                                     ng-required={{prStDe.compulsory}} 
                                     ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
@@ -53,6 +56,7 @@
                             <span ng-repeat="option in optionSets[prStDe.dataElement.optionSet.id].options">
                                 <label>
                                     <input type="radio"
+                                        class="form-control"
                                         ng-class='getInputNotifcationClass(prStDe.dataElement.id,true)'
                                         name={{prStDe.dataElement.id}}
                                         ng-required={{prStDe.compulsory}} 
@@ -68,6 +72,7 @@
                         <div ng-switch-when="int">
                             <input type="number"                                   
                                    number-type={{prStDe.dataElement.numberType}}
+                                   class="form-control"
                                    ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
                                    ng-model="currentEvent[prStDe.dataElement.id]"                                    
                                    d2-number-validator
@@ -80,6 +85,7 @@
                             <span ng-if="prStDe.dataElement.textType==='longText'">
                                 <textarea rows="3"
                                     ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
+                                    class="form-control"
                                     ng-model="currentEvent[prStDe.dataElement.id]" 
                                     ng-required={{prStDe.compulsory}} 
                                     ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
@@ -90,6 +96,7 @@
                             <span ng-if="prStDe.dataElement.textType!=='longText'">
                                 <input type="text"
                                     ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
+                                    class="form-control"
                                     ng-model="currentEvent[prStDe.dataElement.id]" 
                                     ng-required={{prStDe.compulsory}} 
                                     ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
@@ -99,6 +106,7 @@
                         </div>
                         <div ng-switch-when="bool">
                             <select ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
+                                    class="form-control"
                                     ng-model="currentEvent[prStDe.dataElement.id]" 
                                     ng-required={{prStDe.compulsory}} 
                                     ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
@@ -115,6 +123,7 @@
                                    d2-date
                                    d2-date-validator
                                    max-date="prStDe.allowFutureDate ? '' : 0"
+                                   class="form-control"
                                    ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
                                    ng-model="currentEvent[prStDe.dataElement.id]"                                    
                                    ng-required={{prStDe.compulsory}}  
@@ -123,7 +132,8 @@
                                    name="foo"/>
                         </div>
                         <div ng-switch-when="trueOnly">
-                            <input type="checkbox"                         
+                            <input type="checkbox"     
+                                   class="form-control"
                                    ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
                                    ng-model="currentEvent[prStDe.dataElement.id]"                                                               
                                    ng-required={{prStDe.compulsory}} 
@@ -132,7 +142,8 @@
                                    name="foo"/>
                         </div>
                         <div ng-switch-default>
-                            <input type="text"
+                            <input type="text" 
+                                   class="form-control"
                                 ng-class='getInputNotifcationClass(prStDe.dataElement.id,false)'
                                 ng-model="currentEvent[prStDe.dataElement.id]" 
                                 ng-required={{prStDe.compulsory}} 
@@ -158,7 +169,7 @@
     
     <div ng-if='currentEvent && currentStage.programStageSections.length'>
         <accordion close-others='false'>
-			<!-- The inline style was needed to override overflow:hidden in the css. Can possibly be replaced with a CSS update. --> 
+            <!-- The inline style was needed to override overflow:hidden in the css. Can possibly be replaced with a CSS update. --> 
             <accordion-group heading="{{section.name}}" is-open="section.open" ng-repeat='section in currentStage.programStageSections' style="overflow:visible">
                 <table class="dhis2-list-table-striped">                    
                     <thead>                        

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html	2015-06-02 12:25:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html	2015-06-15 15:29:59 +0000
@@ -7,15 +7,19 @@
         <td>
             <ng-form name="innerForm">
                 <span ng-if="attribute.optionSetValue">
-                    <input type="text"
-                            name="foo"
-                            class="form-control typeahead"
-                            ng-model="selectedTei[attribute.id]"                              
-                            placeholder="&#xf0d7;&nbsp;&nbsp;"
-                            typeahead="option.name as option.name for option in optionSets[attributesById[attribute.id].optionSet.id].options | filter:$viewValue | limitTo:20" 
-                            typeahead-focus-first="false"  
-                            typeahead-editable=false                                         
-                            ng-disabled="editingDisabled" ng-required="attribute.mandatory || attribute.unique"/>
+                    <ui-select  ng-model="selectedTei[attribute.id]"
+                                theme="select2" 
+                                ng-required="attribute.mandatory || attribute.unique"
+                                ng-disabled="editingDisabled"
+                                name="foo" 
+                                style="width:100%;">
+                        <ui-select-match allow-clear="true" style="width:100%; height:34px; line-height:1.0; padding: 2px 6px; margin-top:5px" placeholder="{{'select_or_search' | translate}}">{{$select.selected.name  || $select.selected}}</ui-select-match>
+                        <ui-select-choices  infinite-scroll="addMoreOptions()"
+                                            infinite-scroll-distance="2"
+                                            repeat="option.name as option in optionSets[attributesById[attribute.id].optionSet.id].options | filter: $select.search | limitTo:20">
+                          <span ng-bind-html="option.name | highlight: $select.search"></span>
+                        </ui-select-choices>
+                    </ui-select>
                 </span>
                 <span ng-if="!attribute.optionSetValue" ng-switch="attribute.valueType">
                     <span ng-switch-when="date">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-06-10 11:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-06-15 15:29:59 +0000
@@ -26,6 +26,19 @@
     $scope.tei = {};
     $scope.registrationMode = null;
     
+    //Infinite Scroll
+    $scope.infiniteScroll = {};
+    $scope.infiniteScroll.optionsToAdd = 20;
+    $scope.infiniteScroll.currentOptions = 20;
+    
+    $scope.resetInfScroll = function() {
+        $scope.infiniteScroll.currentOptions = $scope.infiniteScroll.optionsToAdd;
+    };
+  
+    $scope.addMoreOptions = function(){
+        $scope.infiniteScroll.currentOptions += $scope.infiniteScroll.optionsToAdd;
+    }; 
+    
     $scope.attributesById = CurrentSelection.getAttributesById();
     if(!$scope.attributesById){
         $scope.attributesById = [];

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-06-10 11:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-06-15 15:29:59 +0000
@@ -3,6 +3,7 @@
 program=Program
 tracked_entity=Tracked Entity
 tracked_entity_attribute=Tracked Entity Attribute
+select_or_search=Select or search from the list
 please_select=[Please select]
 please_select_a_program=[Please select a program]
 no_program_exists=[No program exists]

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html	2015-06-10 11:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html	2015-06-15 15:29:59 +0000
@@ -37,6 +37,9 @@
         <link type="text/css" rel="stylesheet" href="../dhis-web-commons/javascripts/jQuery/calendars/css/ui-redmond.calendars.picker.css">
         
         <script type="text/javascript" src="../dhis-web-commons/select2/select2.min.js"></script>
+        <link type="text/css" rel="stylesheet" href="../dhis-web-commons/javascripts/angular/plugins/select.css">
+        <link type="text/css" rel="stylesheet" href="../dhis-web-commons/javascripts/angular/plugins/select2.css">
+        
         <link type="text/css" rel="stylesheet" media="screen" href="../dhis-web-commons/select2/select2.css">
 
         <script type="text/javascript" src="../dhis-web-commons/bootstrap/js/bootstrap.min.js"></script>     
@@ -82,14 +85,15 @@
         <script src="../dhis-web-commons/ouwt/ouwt.js"></script>
         <script src="scripts/tracker-capture.js"></script>
 
+        <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/select.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/select2.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angularjs-nvd3-directives.min.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angularLocalStorage.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angular-translate.min.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js"></script>
+        <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.validations.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.filters.js"></script>
-        <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.controllers.js"></script>        
 
         <script type="text/javascript" src="scripts/app.js"></script>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/app.js	2015-06-02 12:25:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/app.js	2015-06-15 15:29:59 +0000
@@ -17,6 +17,7 @@
          'd2Services',
          'd2Controllers',
          'angularLocalStorage',
+         'ui.select',
          'ui.select2',
          'd2HeaderBar',
          'ngCsv',

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-06-10 11:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-06-15 15:29:59 +0000
@@ -178,11 +178,11 @@
 }
 
 .input-error {
-    background-color: #ff8a8a;
+    background-color: #ff8a8a !important;
 }
 
 .input-success {
-    background-color: #b9ffb9;
+    background-color: #b9ffb9 !important;
 }
 
 .alert-default {
@@ -583,11 +583,11 @@
     font-size: 14px;
 }
 
-input[type=number], input[type=text], input[type=email], input[type=password], textarea, select {
+/*input[type=number], input[type=text], input[type=email], input[type=password], textarea, select {
     border: 1px solid #aaa;
     padding: 2px 6px;
     font-size: 14px;
-}
+}*/
 
 /*----------------------------------------------------------------------------*/
 /* Search filters
@@ -690,7 +690,8 @@
     font-size: 14px;
     line-height: 1.0;
     color: #555;
-    padding: 6px 6px;
+    //padding: 6px 6px;
+    padding: 6px 0;
     margin-bottom: 5px;
     margin-top: 5px;
     vertical-align: middle;
@@ -703,6 +704,23 @@
     transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
 }
 
+.form-control-trimmed {
+    width: 100%;
+    height: 34px;
+    font-size: 14px;
+    line-height: 1.0;
+    color: #555;
+    padding: 2px 6px;
+    margin-top: 5px;
+    vertical-align: middle;
+    background-image: none;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
+    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
+    -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+}
 .form-control-inline {
     color: #555;
     padding: 6px 6px;
@@ -1104,3 +1122,7 @@
 {
     display:none;
 }
+
+input, button, select, textarea {
+  color: #444;
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html	2015-06-02 12:25:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html	2015-06-15 15:29:59 +0000
@@ -44,6 +44,12 @@
                         <select multiple ui-select2  ng-model="attribute.value" data-placeholder="{{'please_select'| translate}}" style="width:100%;">
                             <option ng-repeat="option in optionSets[attribute.optionSet.id].options| filter:$viewValue | limitTo:100" value="{{option.code}}">{{option.name}}</option>
                         </select>
+                        <!--<ui-select multiple close-on-select="false" ng-model="attribute.value" theme="bootstrap" style="width:100%;">
+                            <ui-select-match style="width:100%;" placeholder="{{'please_select' | translate}}">{{$select.selected.name  || $select.selected}}</ui-select-match>
+                            <ui-select-choices  repeat="option in optionSets[attribute.optionSet.id].options | filter: $select.search | limitTo:100">
+                              <span ng-bind-html="option.name | highlight: $select.search"></span>
+                            </ui-select-choices>
+                        </ui-select>-->
                     </div>
                     <div ng-if="!attribute.optionSetValue" ng-switch="attribute.valueType">
                         <div ng-switch-when="number">

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/select2.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/select2.css	2015-06-15 11:04:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/select2.css	2015-06-15 15:29:59 +0000
@@ -81,6 +81,7 @@
 
 .select2-container.select2-allowclear .select2-choice .select2-chosen {
     margin-right: 42px;
+    //padding: 2px 6px;
 }
 
 .select2-container .select2-choice > .select2-chosen {

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-06-15 11:04:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-06-15 15:29:59 +0000
@@ -277,6 +277,7 @@
 
                             var commonInputFieldProperty = this.getAttributesAsString(attributes) +
                                     ' ng-model="currentEvent.' + fieldId + '" ' +
+                                    ' style="width:100%;" ' +
                                     ' input-field-id="' + fieldId + '"' +
                                     ' ng-class="{{getInputNotifcationClass(prStDes.' + fieldId + '.dataElement.id, true)}}" ' +
                                     ' ng-disabled="selectedEnrollment.status===\'CANCELLED\' || selectedEnrollment.status===\'COMPLETED\' || currentEvent[uid]==\'uid\' || currentEvent.editingNotAllowed"' +
@@ -286,8 +287,8 @@
                                 //check if dataelement has optionset								
                                 if (prStDe.dataElement.optionSetValue) {
                                     var optionSetId = prStDe.dataElement.optionSet.id;                 
-                                    newInputField = '<ui-select class="form-control" theme="select2" ' + commonInputFieldProperty + ' ng-blur="saveDatavalue(prStDes.' + fieldId + ', outerForm.' + fieldId + ')" >' +
-                                            '<ui-select-match allow-clear="true" class="form-control" placeholder="' + $translate.instant('select_or_search') + '">{{$select.selected.name || $select.selected}}</ui-select-match>' +
+                                    newInputField = '<ui-select theme="select2" ' + commonInputFieldProperty + ' on-select="saveDatavalue(prStDes.' + fieldId + ', outerForm.' + fieldId + ')" >' +
+                                            '<ui-select-match allow-clear="true" style="width:100%;" placeholder="' + $translate.instant('select_or_search') + '">{{$select.selected.name || $select.selected}}</ui-select-match>' +
                                             '<ui-select-choices  infinite-scroll="addMoreOptions()" infinite-scroll-distance="2"' +
                                             ' repeat="option.name as option in optionSets.' + optionSetId + '.options | filter: $select.search | limitTo:infiniteScroll.currentOptions">' +
                                             '<span ng-bind-html="option.name | highlight: $select.search"></span>' +
@@ -297,7 +298,7 @@
                                 else {
                                     //check data element type and generate corresponding angular input field
                                     if (prStDe.dataElement.type === "int") {
-                                        newInputField = '<input type="number" class="form-control" ' +
+                                        newInputField = '<input type="number" ' +
                                                 ' d2-number-validator ' +
                                                 ' number-type="' + prStDe.dataElement.numberType + '" ' +
                                                 ' ng-blur="saveDatavalue(prStDes.' + fieldId + ', outerForm.' + fieldId + ')"' +
@@ -386,6 +387,7 @@
 
                             var commonInputFieldProperty = ' name="' + fieldName + '"' +
                                     ' element-id="' + i + '"' +
+                                    ' style="width:100%;" ' +
                                     this.getAttributesAsString(attributes) +
                                     ' d2-focus-next-on-enter' +
                                     ' ng-model="selectedTei.' + attId + '" ' +
@@ -397,9 +399,9 @@
                             if (att.optionSetValue) {
                                 var optionSetId = att.optionSet.id;
                                 newInputField = '<ui-select theme="select2" ' + commonInputFieldProperty + ' >' +
-                                        '<ui-select-match allow-clear="true" placeholder="{{"select_or_search" | translate}}">{{$select.selected.name || $select.selected}}</ui-select-match>' +
-                                        '<ui-select-choices  	infinite-scroll="addMoreOptions()" infinite-scroll-distance="2"' +
-                                        'repeat="option.name as option in optionSets.' + optionSetId + '.options | filter: $select.search | limitTo:infiniteScroll.currentOptions">' +
+                                        '<ui-select-match style="width:100%;" allow-clear="true" placeholder="' + $translate.instant('select_or_search') + '">{{$select.selected.name || $select.selected}}</ui-select-match>' +
+                                        '<ui-select-choices ' +
+                                        'repeat="option.name as option in optionSets.' + optionSetId + '.options | filter: $select.search | limitTo:20">' +
                                         '<span ng-bind-html="option.name | highlight: $select.search"></span>' +
                                         '</ui-select-choices>' +
                                         '</ui-select>';
@@ -422,7 +424,7 @@
                                             '</select> ';
                                 }
                                 else if (att.valueType === "date") {
-                                    newInputField = '<input type="text" ' +
+                                    newInputField = '<input  type="text" ' +
                                             ' placeholder="{{dhis2CalendarFormat.keyDateFormat}}" ' +
                                             ' max-date="' + attMaxDate + '"' + '\'' +
                                             ' d2-date' +