[open-ils-commits] r12072 - trunk/Open-ILS/web/js/dojo/openils/widget

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Feb 4 23:36:10 EST 2009


Author: erickson
Date: 2009-02-04 23:36:08 -0500 (Wed, 04 Feb 2009)
New Revision: 12072

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
Log:
selected-ness follow mouse and key navigation in a uniform fashion.

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-02-04 22:51:11 UTC (rev 12071)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-02-05 04:36:08 UTC (rev 12072)
@@ -15,11 +15,14 @@
             editOnEnter : false, 
 
             startup : function() {
+
+                this.selectionMode = 'single';
                 this.inherited(arguments);
                 this.initAutoEnv();
                 var existing = (this.structure && this.structure[0].cells[0]) ? 
                     this.structure[0].cells[0] : [];
                 var fields = [];
+
                 for(var f in this.sortedFieldList) {
                     var field = this.sortedFieldList[f];
                     if(!field || field.virtual) continue;
@@ -30,6 +33,7 @@
                     if(!entry.get) 
                         entry.get = openils.widget.AutoGrid.defaultGetter
                 }
+
                 this.setStructure([{cells: [fields]}]);
                 this.setStore(this.buildAutoStore());
                 if(this.editOnEnter) 
@@ -38,13 +42,14 @@
 
             /* capture keydown and launch edit dialog on enter */
             _applyEditOnEnter : function() {
+
                 this.onMouseOverRow = function(e) {};
                 this.onMouseOutRow = function(e) {};
                 this.onCellFocus = function(cell, rowIndex) { 
-                    openils.Util.addCSSClass(
-                        cell.getNode(rowIndex).parentNode,
-                        'oils-grid-row-selected');
-                }
+                    this.selection.deselectAll();
+                    this.selection.select(this.focus.rowIndex);
+                };
+
                 dojo.connect(this, 'onKeyDown',
                     function(e) {
                         if(e.keyCode == dojo.keys.ENTER) {



More information about the open-ils-commits mailing list