Fixes issue 19730: Focus now stars in first filter editor field
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 14 Feb 2012 15:10:03 +0100
changeset 15493 cdcbb0c7f479
parent 15492 f4324ff133a7
child 15494 215fbb471eaa
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	Tue Feb 14 14:13:35 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Tue Feb 14 15:10:03 2012 +0100
@@ -127,7 +127,8 @@
       length = items.length;
       for (i = 0; i < length; i++) {
         item = items[i];
-        if (item.getCanFocus() && !item.isDisabled()) {
+        // The first filterable item (editorType!=='StaticTextItem') should be focused
+        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	Tue Feb 14 14:13:35 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Tue Feb 14 15:10:03 2012 +0100
@@ -501,6 +501,11 @@
       this.deleteSelectedParentRecordFilter(localState);
 
       this.Super('setViewState', ['(' + isc.Comm.serialize(localState, false) + ')']);
+      
+      // Focus on the first filterable item
+      if (this.view.isActiveView()) {
+        this.focusInFirstFilterEditor();  
+      }      
     }
 
     if (localState.noFilterClause) {