details:   /erp/devel/pi/rev/c80a631e4a1f
changeset: 11473:c80a631e4a1f
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Tue Apr 05 10:10:14 2011 +0200
summary:   Fixes issue 16603: Autosave disabled doesn't work on grid

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  13 ++++++---
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 966854b29a2b -r c80a631e4a1f 
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
  Tue Apr 05 09:38:33 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Tue Apr 05 10:10:14 2011 +0200
@@ -1052,15 +1052,20 @@
   
   selectOnMouseDown: function(record, recordNum, fieldNum, autoSaveDone){
     // don't change selection on right mouse down
-    var EH = isc.EventHandler, eventType;
+    var EH = isc.EventHandler, eventType = EH.getEventType();
     this.wasEditing = this.view.isEditingGrid;
     
     // don't do anything if right-clicking on a selected record
     if (EH.rightButtonDown() && this.isSelected(record)) {
       return;
     }
+
+    // do autosave when this is a click on a checkbox field or when this is not
+    // a mouse event, in other cases the autosave is done as part of the 
recordclick
+    // which is called for a mousedown also
+    var passToAutoSave = this.getCheckboxFieldPosition() === fieldNum || 
!EH.isMouseEvent(eventType);
     
-    if (!autoSaveDone) {
+    if (!autoSaveDone && passToAutoSave) {
       var actionObject = {
         target: this,
         method: this.selectOnMouseDown,
@@ -1103,7 +1108,6 @@
       // if this method here would also handle mouseclicks then the
       // doubleClick
       // event is not captured anymore
-      eventType = EH.getEventType();
       if (!EH.isMouseEvent(eventType)) {
         this.handleRecordSelection(null, record, recordNum, null, fieldNum, 
null, null, true);
       }
@@ -1567,7 +1571,8 @@
       }
     }
     this.Super('saveEditedValues', [rowNum, colNum, newValues, oldValues, 
editValuesID, editCompletionEvent, saveCallback]);
-    this.view.standardWindow.setDirtyEditForm(null);
+    // commented out as it removes an autosave action which is done in the 
edit complete method
+//    this.view.standardWindow.setDirtyEditForm(null);
   },
   
   autoSave: function(){

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to