[open-ils-commits] r12337 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Mar 1 16:20:54 EST 2009


Author: erickson
Date: 2009-03-01 16:20:49 -0500 (Sun, 01 Mar 2009)
New Revision: 12337

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
Log:
plugged in auto edit pane handling

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-03-01 20:36:23 UTC (rev 12336)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-03-01 21:20:49 UTC (rev 12337)
@@ -15,6 +15,7 @@
             /* if true, pop up an edit dialog when user hits Enter on a give row */
             editOnEnter : false, 
             defaultCellWidth : null,
+            editStyle : 'dialog',
 
             /* by default, don't show auto-generated (sequence) fields */
             showSequenceFields : false, 
@@ -92,7 +93,10 @@
 
                 dojo.connect(this, 'onRowDblClick',
                     function(e) {
-                        this._drawEditDialog(this.selection.getFirstSelected(), this.focus.rowIndex);
+                        if(this.editStyle == 'pane')
+                            this._drawEditPane(this.selection.getFirstSelected(), this.focus.rowIndex);
+                        else
+                            this._drawEditDialog(this.selection.getFirstSelected(), this.focus.rowIndex);
                     }
                 );
 
@@ -101,7 +105,10 @@
                         if(e.keyCode == dojo.keys.ENTER) {
                             this.selection.deselectAll();
                             this.selection.select(this.focus.rowIndex);
-                            this._drawEditDialog(this.selection.getFirstSelected(), this.focus.rowIndex);
+                            if(this.editStyle == 'pane')
+                                this._drawEditPane(this.selection.getFirstSelected(), this.focus.rowIndex);
+                            else
+                                this._drawEditDialog(this.selection.getFirstSelected(), this.focus.rowIndex);
                         }
                     }
                 );
@@ -193,6 +200,15 @@
                 this.editDialog.show();
             },
 
+            _drawEditPane : function(storeItem, rowIndex) {
+                var self = this;
+                var done = function() { self.hidePane(); };
+                this.editPane = this._makeEditPane(storeItem, rowIndex, done, done);
+                this.editPane.startup();
+                this.domNode.parentNode.insertBefore(this.editPane.domNode, this.domNode);
+                dojo.style(this.domNode, 'display', 'none');
+            },
+
             showCreatePane : function() {
                 var self = this;
                 var done = function() { self.hidePane(); };



More information about the open-ils-commits mailing list