details:   /erp/devel/pi/rev/010f74bb0868
changeset: 10916:010f74bb0868
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Feb 28 18:20:10 2011 +0100
summary:   Removed non necessary parts related to column heights from grid 
styles

details:   /erp/devel/pi/rev/2ceba3875bf1
changeset: 10917:2ceba3875bf1
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Feb 28 18:20:40 2011 +0100
summary:   Fixes issue 15691: Staying in edit mode when clicking other 
rows/grids

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
                                                             |  43 +++++----
 
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/org.openbravo.client.application/ob-grid-styles.js
 |   2 -
 2 files changed, 24 insertions(+), 21 deletions(-)

diffs (175 lines):

diff -r 3f91546fe8f1 -r 2ceba3875bf1 
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
  Mon Feb 28 17:53:56 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Mon Feb 28 18:20:40 2011 +0100
@@ -458,7 +458,7 @@
   
   // overridden to prevent the filter editor fields from using the 
   // grids datasource
-  getFilterEditorProperties: function(field) {
+  getFilterEditorProperties: function(field){
     return isc.addProperties({
       optionDataSource: null
     }, this.Super('getFilterEditorProperties', arguments));
@@ -720,7 +720,7 @@
     var actionObject = {
       target: this,
       method: this.handleRecordSelection,
-      parameters: [viewer, record, recordNum, field, fieldNum, value, 
rawValue, false]
+      parameters: [viewer, record, recordNum, field, fieldNum, value, 
rawValue, false, this.view.isEditingGrid]
     };
     this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
   },
@@ -857,6 +857,7 @@
   selectOnMouseDown: function(record, recordNum, fieldNum, autoSaveDone){
     // don't change selection on right mouse down
     var EH = isc.EventHandler, eventType;
+    this.wasEditing = this.view.isEditingGrid;
     
     if (!autoSaveDone) {
       var actionObject = {
@@ -909,15 +910,18 @@
   },
   
   handleRecordSelection: function(viewer, record, recordNum, field, fieldNum, 
value, rawValue, fromSelectOnMouseDown){
+    var wasEditing = this.wasEditing;
+    delete this.wasEditing;
     var EH = isc.EventHandler;
     var keyName = EH.getKey();
     
     // stop editing if the user clicks out of the row
-    if (this.getEditRow() && this.getEditRow() !== recordNum) {
+    if ((this.getEditRow() || this.getEditRow() === 0) && this.getEditRow() 
!== recordNum) {
       this.endEditing();
+      wasEditing = true;
     }
     // do nothing, click in the editrow itself
-    if (this.getEditRow() && this.getEditRow() === recordNum) {
+    if ((this.getEditRow() || this.getEditRow() === 0) && this.getEditRow() 
=== recordNum) {
       return;
     }
     
@@ -961,6 +965,11 @@
     } else {
       // click on the record which was already selected
       this.doSelectSingleRecord(record);
+      
+      // if we were editing then a single click continue edit mode
+      if (wasEditing) {
+        this.startEditing(recordNum, fieldNum);
+      }
     }
     
     this.updateSelectedCountDisplay();
@@ -1132,7 +1141,7 @@
     } else if (this.getSelectedRecord() === record) {
       this.view.refreshChildViews();
     }
-        
+    
     // remove the error style/message
     this.setRecordErrorMessage(rowNum, null);
     // update after the error message has been removed
@@ -1173,7 +1182,7 @@
     var localArguments = arguments;
     var me = this, record = this.getRecord(rowNum);
     
-    if (!preventConfirm && 
+    if (!preventConfirm &&
     (this.getEditForm().hasChanged || this.rowHasErrors(rowNum))) {
       isc.ask(OB.I18N.getLabel('OBUIAPP_ConfirmCancelEdit'), function(value){
         if (value) {
@@ -1214,14 +1223,14 @@
       }
       
       this.view.standardWindow.cleanUpAutoSaveProperties();
-       
+      
       // update after removing the error msg
       this.view.updateTabTitle();
       this.view.toolBar.updateButtonState(true);
     }
   },
   
-  saveEdits: function (editCompletionEvent, callback, rowNum, colNum, 
validateOnly) {
+  saveEdits: function(editCompletionEvent, callback, rowNum, colNum, 
validateOnly){
     var ret = this.Super('saveEdits', arguments);
     // save was not done, because there were no changes probably
     if (!ret) {
@@ -1236,8 +1245,7 @@
   // latest values. This can happen when the focus is in a field and the save 
action is
   // done, at that point first try to force a fic call (handleItemChange) and 
if that
   // indeed happens stop the saveEdit until the fic returns
-  saveEditedValues: function (rowNum, colNum, newValues, oldValues, 
-                             editValuesID, editCompletionEvent, saveCallback, 
ficCallDone) {
+  saveEditedValues: function(rowNum, colNum, newValues, oldValues, 
editValuesID, editCompletionEvent, saveCallback, ficCallDone){
     if (!rowNum && rowNum !== 0) {
       rowNum = this.getEditRow();
     }
@@ -1248,10 +1256,7 @@
     // nothing changed just fire the calback and bail
     if (!ficCallDone && this.getEditForm() && !this.getEditForm().hasChanged 
&& !this.getEditForm().isNew) {
       if (saveCallback) {
-          this.fireCallback(saveCallback, 
-                            "rowNum,colNum,editCompletionEvent,success", 
-                            [rowNum,colNum,editCompletionEvent,success]
-          );
+        this.fireCallback(saveCallback, 
"rowNum,colNum,editCompletionEvent,success", [rowNum, colNum, 
editCompletionEvent, success]);
       }
       return true;
     }
@@ -1278,7 +1283,7 @@
     }
     this.Super('saveEditedValues', [rowNum, colNum, newValues, oldValues, 
editValuesID, editCompletionEvent, saveCallback]);
   },
-
+  
   autoSave: function(){
     this.storeUpdatedEditorValue();
     this.endEditing();
@@ -1316,9 +1321,9 @@
       }
       // if the focus does not get suppressed then the clicked field will 
receive focus
       // and won't be disabled so the user can already start typing      
-      suppressFocus = true; 
+      suppressFocus = true;
     }
-
+    
     var ret = this.Super('showInlineEditor', [rowNum, colNum, newCell, newRow, 
suppressFocus]);
     if (!newRow) {
       return ret;
@@ -1394,7 +1399,7 @@
     return ret;
   },
   
-  refreshEditRow: function() {
+  refreshEditRow: function(){
     var editRow = this.view.viewGrid.getEditRow();
     if (editRow || editRow === 0) {
       // don't refresh the frozen fields, this give strange
@@ -1787,5 +1792,5 @@
   
   doCancel: function(){
     this.grid.cancelEditing();
-  }  
+  }
 });
diff -r 3f91546fe8f1 -r 2ceba3875bf1 
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/org.openbravo.client.application/ob-grid-styles.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/org.openbravo.client.application/ob-grid-styles.js
      Mon Feb 28 17:53:56 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/org.openbravo.client.application/ob-grid-styles.js
      Mon Feb 28 18:20:40 2011 +0100
@@ -28,7 +28,6 @@
   headerBarStyle: 'OBGridHeaderBar',
   headerTitleStyle: 'OBGridHeaderCellTitle',
   cellPadding: 0, /* Set in the CSS */
-  cellHeight: 22,
   cellAlign: 'center',
   
sortAscendingImage:{src:'[SKIN]/../../../org.openbravo.client.application/images/grid/gridHeader_sortAscending.gif',
 width:7, height:11},
   
sortDescendingImage:{src:'[SKIN]/../../../org.openbravo.client.application/images/grid/gridHeader_sortDescending.gif',
 width:7, height:11},
@@ -37,7 +36,6 @@
   headerMenuButtonSrc: 
'[SKIN]/../../org.openbravo.client.application/images/grid/gridHeaderMenuButton.png',
   hoverWidth: 200,
   editLinkColumnWidth: 58,
-  recordComponentHeight: 19,
 
   summaryRowConstructor: 'OBGridSummary',
   summaryRowDefaults:{

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to