details:   /erp/devel/pi/rev/7ad88b02e0da
changeset: 12531:7ad88b02e0da
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon May 30 09:48:34 2011 +0200
summary:   Related to issue 16627: Now it is not possible to filter by just one 
date directly from the grid

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
 |  19 ++++++---
 1 files changed, 13 insertions(+), 6 deletions(-)

diffs (73 lines):

diff -r e2f572d57e79 -r 7ad88b02e0da 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
       Mon May 30 09:00:57 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
       Mon May 30 09:48:34 2011 +0200
@@ -132,24 +132,24 @@
   },
   
   expandSingleValue: function(){
-    var newValue = this.parseValue(), oldValue = this.getValue(), dateValue, 
editRow;
+    var newValue = this.parseValue(), oldValue = this.mapValueToDisplay(), 
dateValue, editRow;
     
     if (!this.singleDateMode) {
       return;
     }
     
-    if (this.singleDateMode && oldValue !== newValue) {
+    if (this.singleDateMode) {
       dateValue = OB.Utilities.Date.OBToJS(newValue, this.dateFormat);
       if (isc.isA.Date(dateValue)) {
         this.singleDateValue = dateValue;
         this.singleDateDisplayValue = newValue;
         this.singleDateMode = true;
         this.setElementValue(newValue, newValue);
-        return true;
       } else {
         this.singleDateValue = null;
         this.singleDateMode = false;
       }
+      return true;
     }
     return false;
   },
@@ -190,7 +190,7 @@
   },
 
   getCriterion: function() {
-    if (this.singleDateMode) {
+    if (this.singleDateValue) {
       return {
         fieldName: this.name,
         operator: 'equals', 
@@ -212,6 +212,10 @@
        : false;
   },
 
+  itemHoverHTML: function(item, form) {
+    return this.mapValueToDisplay();
+  },
+  
   updateStoredDates: function() {
     var value = this.rangeItemValue, i;
     
@@ -320,16 +324,19 @@
     if (keyName === 'Enter') {
       if (this.singleDateMode) {
         this.expandSingleValue();
-        return this.Super('keyPress', arguments);
+        this.form.grid.performAction();
+        return false;
       }
       this.showRangeDialog();
       return false;
-    } else {
+    } else if (characterValue || keyName === 'Backspace' || keyName === 
'Delete') {
+      // only do this if something got really typed in
       this.fromDate = null;
       this.toDate = null;
       
       // typing, change to single date mode
       this.singleDateMode = true;
+      this.singleDateValue = null;
       this.rangeItemValue = null;
       // typing a new value
       this.singleDateDisplayValue = null;

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to