details:   https://code.openbravo.com/erp/devel/pi/rev/a4e7ab3c00b3
changeset: 28266:a4e7ab3c00b3
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Tue Jan 19 08:50:03 2016 +0100
summary:   fixes issue 31904: 'Filter on change' option set to N does not work

The text items were not accessing properly to the 'filter on change' property. 
For P&E grids an additional problem was happening: the value of a variable 
called actOnKeypress used to disable/enbale the filtering on change was being 
overriden by the evaluateDisplayLogicForGridColumns() function. Also, the 
filter when pressing enter was not being working neither because the 
editFormDefaults values were not being used properly in P&E.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-text.js
   |  6 +++++-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
 |  2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 1e99517ffbe9 -r a4e7ab3c00b3 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-text.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-text.js
        Tue Jan 19 07:54:44 2016 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-text.js
        Tue Jan 19 08:50:03 2016 +0100
@@ -128,8 +128,12 @@
 
   init: function () {
     var field = this.grid.getField(this.name);
-    if (field && field.gridProps && field.gridProps.filterOnChange === false) {
+    if (field && field.gridProps && field.gridProps.filterEditorProperties && 
field.gridProps.filterEditorProperties.filterOnChange === false) {
       this.actOnKeypress = false;
+      // Explicitly sets the filterOnKeypress property of the field.
+      // This prevents the restoring of this.actOnKeypress to true when it 
should remain false.
+      // See issue https://issues.openbravo.com/view.php?id=31904
+      field.filterOnKeypress = false;
     }
     this.Super('init', arguments);
   },
diff -r 1e99517ffbe9 -r a4e7ab3c00b3 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
      Tue Jan 19 07:54:44 2016 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
      Tue Jan 19 08:50:03 2016 +0100
@@ -81,7 +81,7 @@
 
     // the getValuesAsCriteria function of the edit form of the filter editor 
should always be called with 
     // advanced = true to guarantee that the returned criteria will have the 
proper format
-    this.filterEditorDefaults.editFormDefaults = 
this.filterEditorDefaults.editFormDefaults || {};
+    this.filterEditorDefaults.editFormDefaults = this.editFormDefaults || {};
     this.filterEditorDefaults.editFormDefaults.originalGetValuesAsCriteria = 
isc.DynamicForm.getPrototype().getValuesAsCriteria;
     this.filterEditorDefaults.editFormDefaults.getValuesAsCriteria = function 
(advanced, textMatchStyle, returnNulls) {
       var useAdvancedCriteria = true;

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to