when using the popup dialog, overide the default focus handling. this is still exper...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Feb 2009 22:50:23 +0000 (22:50 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Feb 2009 22:50:23 +0000 (22:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12070 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoGrid.js

index 4d95cd4..7f8f5d0 100644 (file)
@@ -39,19 +39,24 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
             /* capture keydown and launch edit dialog on enter */
             _applyEditOnEnter : function() {
                 this.onMouseOverRow = function(e) {};
-                this.onMouseOut = function(e) {};
+                this.onMouseOutRow = function(e) {};
+                this.onCellFocus = function(cell, rowIndex) { 
+                    openils.Util.addCSSClass(
+                        cell.getNode(rowIndex).parentNode,
+                        'oils-grid-row-selected');
+                }
                 dojo.connect(this, 'onKeyDown',
                     function(e) {
                         if(e.keyCode == dojo.keys.ENTER) {
                             this.selection.deselectAll();
                             this.selection.select(this.focus.rowIndex);
-                            this._drawEditDialog(this.selection.getFirstSelected());
+                            this._drawEditDialog(this.selection.getFirstSelected(), this.focus.rowIndex);
                         }
                     }
                 );
             },
 
-            _drawEditDialog : function(storeItem) {
+            _drawEditDialog : function(storeItem, rowIndex) {
                 var grid = this;
                 var fmObject = new fieldmapper[this.fmClass]().fromStoreItem(storeItem);
                 var idents = grid.store.getIdentityAttributes();