Fixes issue 25938: Enables using the arrow keys to navigate in a grouped grid
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 10 Mar 2014 16:00:03 +0100
changeset 22665 11230817c0bc
parent 22664 000a54089250
child 22666 c610696ad844
Fixes issue 25938: Enables using the arrow keys to navigate in a grouped grid
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Mon Mar 10 11:25:37 2014 -0300
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Mon Mar 10 16:00:03 2014 +0100
@@ -179,7 +179,7 @@
   },
 
   bodyKeyPress: function (event, eventInfo) {
-    if (eventInfo && this.lastSelectedRecord && ((eventInfo.keyName === isc.OBViewGrid.ARROW_UP_KEY_NAME && this.data.localData[0].id === this.lastSelectedRecord.id) || (eventInfo.keyName === isc.OBViewGrid.ARROW_DOWN_KEY_NAME && this.data.localData[this.data.localData.length - 1] && this.data.localData[this.data.localData.length - 1].id === this.lastSelectedRecord.id))) {
+    if (eventInfo && this.lastSelectedRecord && ((eventInfo.keyName === isc.OBViewGrid.ARROW_UP_KEY_NAME && this.data.localData && this.data.localData[0].id === this.lastSelectedRecord.id) || (eventInfo.keyName === isc.OBViewGrid.ARROW_DOWN_KEY_NAME && this.data.localData && this.data.localData[this.data.localData.length - 1] && this.data.localData[this.data.localData.length - 1].id === this.lastSelectedRecord.id))) {
       return true;
     }
     var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.body', this);