details:   /erp/devel/pi/rev/5e97adac7909
changeset: 11160:5e97adac7909
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Wed Mar 09 13:47:34 2011 -0600
summary:   Enabled grid row modal editing

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
 |  20 ++++++++++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  20 ++++++++--
 2 files changed, 36 insertions(+), 4 deletions(-)

diffs (88 lines):

diff -r 715e5f37db43 -r 5e97adac7909 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Wed Mar 09 19:36:04 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Wed Mar 09 13:47:34 2011 -0600
@@ -182,6 +182,26 @@
     }
   },
   
+  // add the undo buttons to the clickmask so that no save happens when 
+  // clicking undo
+  showClickMask : function(clickAction, mode, unmaskedTargets) {
+    if (!isc.isA.Array(unmaskedTargets)) {
+      if (!unmaskedTargets) {
+        unmaskedTargets = [];
+      } else {
+        unmaskedTargets = [unmaskedTargets];
+      }
+    } 
+    // the main undo button
+    unmaskedTargets.push(this.view.toolBar.getLeftMember('undo'));
+    
+    // the row cancel button
+    if (this.view.viewGrid.getSelectedRecord() && 
this.view.viewGrid.getSelectedRecord().editColumnLayout) {
+      
unmaskedTargets.push(this.view.viewGrid.getSelectedRecord().editColumnLayout.cancelButton);
+    }
+    this.Super('showClickMask', [clickAction, mode, unmaskedTargets]);
+  },  
+  
   setNewState: function(isNew){
     this.isNew = isNew;
     this.view.statusBar.setNewState(isNew);
diff -r 715e5f37db43 -r 5e97adac7909 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Wed Mar 09 19:36:04 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Wed Mar 09 13:47:34 2011 -0600
@@ -137,7 +137,8 @@
   
   // modal editing is not possible as we need to be able to do 
   // undo, which means clicks outside of the current form.
-  modalEditing: false,
+  modalEditing: true,
+  //showGridSummary: true,
   
   timeFormatter: 'to24HourTime',
   
@@ -167,6 +168,16 @@
     }
   },
   
+  cellEditEnd: function(ece) {
+    if (ece === isc.ListGrid.CLICK_OUTSIDE) {
+      // finished editing on a click outside of the 
+      // current edit row
+      this.endEditing();
+    } else {
+      this.Super('cellEditEnd', arguments);
+    }    
+  },
+
   refreshFields: function(){
     this.setFields(this.completeFields.duplicate());
   },
@@ -1852,7 +1863,7 @@
   record: null,
   
   initWidget: function(){
-    var me = this, formButton, cancelButton, saveButton;
+    var me = this, formButton, saveButton;
     
     this.progressIcon = isc.Img.create(this.grid.progressIconDefaults);
     
@@ -1902,7 +1913,8 @@
       }
     });
     
-    cancelButton = isc.OBGridToolStripIcon.create({
+    // is referred to in OBViewForm.showClickMask
+    this.cancelButton = isc.OBGridToolStripIcon.create({
       buttonType: 'cancel',
       prompt: OB.I18N.getLabel('OBUIAPP_GridCancelButtonPrompt'),
       action: function(){
@@ -1927,7 +1939,7 @@
     buttonSeparator2 = isc.OBGridToolStripSeparator.create({});
     
     this.OBGridToolStrip = isc.OBGridToolStrip.create({
-      members: [formButton, this.buttonSeparator1, this.editButton, 
cancelButton, buttonSeparator2, saveButton]
+      members: [formButton, this.buttonSeparator1, this.editButton, 
this.cancelButton, buttonSeparator2, saveButton]
     });
     
     this.addMember(this.progressIcon);

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to