details:   /erp/devel/pi/rev/89a1a5a3a38d
changeset: 12442:89a1a5a3a38d
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Wed May 25 23:53:38 2011 +0200
summary:   Fixes issue 17355: Grid buttons are not working well. It shows wrong 
ones. Happens in the three browsers FF4, IE9, Chrome

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
   |  7 +++++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 0df2fd25b7ea -r 89a1a5a3a38d 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
    Wed May 25 21:13:51 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
    Wed May 25 23:53:38 2011 +0200
@@ -103,7 +103,11 @@
       
       // In case of no record selected getRecordIndex(undefined) returns -1,
       // which is the top position, other case it adds bellow current selected 
row.
-      view.newRow(grid.getRecordIndex(grid.getSelectedRecord()));
+      if (grid.getSelectedRecord()) {
+        view.newRow(grid.getRecordIndex(grid.getSelectedRecord()));
+      } else {
+        view.newRow(0);
+      }
     },
     buttonType: 'newRow',
     prompt: OB.I18N.getLabel('OBUIAPP_NewRow'),
@@ -557,7 +561,6 @@
   // NOTE: new buttons should implement the updateState method.
   //
   updateButtonState: function(noSetSession, changeEvent){
-
     for (i = 0; i < this.leftMembers.length; i++) {
       if (this.leftMembers[i].updateState) {
         this.leftMembers[i].updateState();
diff -r 0df2fd25b7ea -r 89a1a5a3a38d 
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 May 25 21:13:51 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Wed May 25 23:53:38 2011 +0200
@@ -1426,7 +1426,8 @@
     if (rowNum || rowNum === 0) {
       insertRow = rowNum + 1;
     } else {
-      insertRow = this.getTotalRows();
+      
+      insertRow = this.getDrawArea()[0];
     }
     this.createNewRecordForEditing(insertRow);
     this.startEditing(insertRow);

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to