details:   https://code.openbravo.com/erp/devel/pi/rev/74b23c560ef9
changeset: 24455:74b23c560ef9
user:      Inigo Sanchez <inigo.sanchez <at> openbravo.com>
date:      Mon Sep 22 14:25:13 2014 +0200
summary:   Fixed issue 27544: Another visibility problems in some dropdown sel.

Last solution does not work properly if the field being tested is not the 
leftmost field.

To fix this, a new parameter, leftFieldsWidth, has been added to the 
setPickListWidth function.
In this function, it has been solved last problem.

diffstat:

 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
 |  12 +++++++--
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 99b060690c1f -r 74b23c560ef9 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
--- 
a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Fri Sep 19 18:22:36 2014 +0000
+++ 
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Mon Sep 22 14:25:13 2014 +0200
@@ -596,16 +596,22 @@
 
   setPickListWidth: function () {
     var extraWidth = 0,
+        leftFieldsWidth = 0,
+        i = 0,
+        nameField = this.name,
         fieldWidth = this.getVisibleWidth();
     // minimum width for smaller fields.
     fieldWidth = (fieldWidth < 150 ? 150 : fieldWidth);
     // Dropdown selector that shows more than one column.
     if (this.pickListFields.length > 1) {
+      // calculate width of checkBox and first fields before selector field
+      while (i < this.grid.fields.size() && 
nameField.localeCompare(this.grid.fields.get(i).valueField) != 0) {
+        leftFieldsWidth = leftFieldsWidth + this.grid.fields.get(i).width;
+        i++;
+      }
       // prevents a pickListWidth longer than width of the grid.
-      // 89 is the width of checkBox + edit in form + edit in grid.
-      extraWidth = Math.min(150 * (this.pickListFields.length - 1), 
this.grid.width - fieldWidth - 89);
+      extraWidth = Math.min(150 * (this.pickListFields.length - 1), 
this.grid.width - fieldWidth - leftFieldsWidth);
     }
-
     this.pickListWidth = fieldWidth + extraWidth;
   },
 

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to