Prevent default filter application when moving selector window
authorMartin Taal <martin.taal@openbravo.com>
Tue, 08 Mar 2011 15:30:02 +0100
changeset 11104 06163e1d01f1
parent 11103 367dbc74a9bc
child 11105 b2a677fef048
Prevent default filter application when moving selector window
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js	Tue Mar 08 15:29:39 2011 +0100
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js	Tue Mar 08 15:30:02 2011 +0100
@@ -207,13 +207,14 @@
     this.selector.focusInItem();
   },
 
-  show: function(){
+  show: function(applyDefaultFilter){
     // draw now already otherwise the filter does not work the
     // first time    
     var ret = this.Super('show', arguments);
-    this.selectorGrid.setFilterEditorCriteria(this.defaultFilter);
-    this.selectorGrid.filterByEditor();
-
+    if (applyDefaultFilter) {
+      this.selectorGrid.setFilterEditorCriteria(this.defaultFilter);
+      this.selectorGrid.filterByEditor();
+    }
     if(this.selectorGrid.isDrawn()) {
       this.selectorGrid.focusInFilterEditor();
     } else {
@@ -253,7 +254,7 @@
     // adds the selector id to filter used to get filter information
     defaultFilter._selectorDefinitionId = this.selector.selectorDefinitionId;
     this.defaultFilter = defaultFilter;
-    this.show();
+    this.show(true);
   },
   
   setValueInField: function(){