From 987bc6134f3921d19390e1ad80182d7f35bc01d0 Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 1 Mar 2009 21:20:49 +0000 Subject: [PATCH] plugged in auto edit pane handling git-svn-id: svn://svn.open-ils.org/ILS/trunk@12337 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/widget/AutoGrid.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index d6fb623c58..aa8ab1cd29 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -15,6 +15,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { /* 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 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { 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(!dojo._hasResource['openils.widget.AutoGrid']) { 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 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { 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(); }; -- 2.11.0