details:   /erp/devel/pi/rev/c242649f3689
changeset: 11032:c242649f3689
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Sat Mar 05 15:49:33 2011 +0100
summary:   Fixes issue 16139 Selecting new record in grid from context menu in 
white space click should add new record at the end of the list

details:   /erp/devel/pi/rev/94907954324a
changeset: 11033:94907954324a
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Sat Mar 05 15:49:59 2011 +0100
summary:   Fixes issue 16138: Add undo changes to the line context menu

diffstat:

 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
               |  11 +++++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  20 ++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diffs (56 lines):

diff -r 98b3b41b82c0 -r 94907954324a 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
--- 
a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
        Sat Mar 05 14:44:53 2011 +0100
+++ 
b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
        Sat Mar 05 15:49:59 2011 +0100
@@ -1190,4 +1190,15 @@
 <!--FF8081812E7BEED8012E7BFA9EC0000D-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--FF8081812E7BEED8012E7BFA9EC0000D--></AD_MESSAGE>
 
+<!--FF8081812E867351012E867555F90008--><AD_MESSAGE>
+<!--FF8081812E867351012E867555F90008-->  
<AD_MESSAGE_ID><![CDATA[FF8081812E867351012E867555F90008]]></AD_MESSAGE_ID>
+<!--FF8081812E867351012E867555F90008-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8081812E867351012E867555F90008-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8081812E867351012E867555F90008-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8081812E867351012E867555F90008-->  
<VALUE><![CDATA[OBUIAPP_UndoChanges]]></VALUE>
+<!--FF8081812E867351012E867555F90008-->  <MSGTEXT><![CDATA[Undo 
changes]]></MSGTEXT>
+<!--FF8081812E867351012E867555F90008-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--FF8081812E867351012E867555F90008-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--FF8081812E867351012E867555F90008--></AD_MESSAGE>
+
 </data>
diff -r 98b3b41b82c0 -r 94907954324a 
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
  Sat Mar 05 14:44:53 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Sat Mar 05 15:49:59 2011 +0100
@@ -849,6 +849,24 @@
     var singleSelected = this.getSelectedRecords().length === 1;
     var field = this.getField(colNum);
     var grid = this;
+    if (recordsSelected) {
+      var allSelectedHaveErrors = true;
+      for (var i = 0; i < this.getSelectedRecords().length; i++) {
+        var localRowNum = this.getRecordIndex(this.getSelectedRecords()[i]);
+        if (!this.rowHasErrors(localRowNum)) {
+          allSelectedHaveErrors = false;
+          break;
+        }
+      }
+      if (allSelectedHaveErrors) {
+        menuItems.add({
+          title: OB.I18N.getLabel('OBUIAPP_UndoChanges'),
+          click: function(){
+            grid.view.undo();
+          }
+        });
+      }
+    }
     menuItems.add({
       title: OB.I18N.getLabel('OBUIAPP_CreateRecordInGrid'),
       click: function(){
@@ -1153,6 +1171,8 @@
     var insertRow = this.getDrawArea()[0];
     if (rowNum || rowNum === 0) {
       insertRow = rowNum + 1;
+    } else {
+      insertRow = this.getTotalRows();
     }
     this.createNewRecordForEditing(insertRow);
     this.startEditing(insertRow);

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to