Fixes issue 19730: Focus now stars in first filter editor field
authorAugusto Mauch <augusto.mauch@openbravo.com>
Wed, 15 Feb 2012 10:25:57 +0100
changeset 15497 cde4b46243eb
parent 15496 fd30d7d69072
child 15498 88d115937592
Fixes issue 19730: Focus now stars in first filter editor field
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Wed Feb 15 09:46:47 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Wed Feb 15 10:25:57 2012 +0100
@@ -128,7 +128,7 @@
       for (i = 0; i < length; i++) {
         item = items[i];
         // The first filterable item (editorType!=='StaticTextItem') should be focused
-        if (item.getCanFocus() && !item.isDisabled()) {
+        if (item.getCanFocus() && !item.isDisabled() && item.editorType !== 'StaticTextItem') {
           this.focusInFilterEditor(item);
           return true;
         }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Wed Feb 15 09:46:47 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Wed Feb 15 10:25:57 2012 +0100
@@ -500,7 +500,12 @@
 
       this.deleteSelectedParentRecordFilter(localState);
 
-      this.Super('setViewState', ['(' + isc.Comm.serialize(localState, false) + ')']);     
+      this.Super('setViewState', ['(' + isc.Comm.serialize(localState, false) + ')']);
+
+      // Focus on the first filterable item
+      if (this.view.isActiveView()) {
+        this.focusInFirstFilterEditor();
+      }
     }
 
     if (localState.noFilterClause) {