details:   https://code.openbravo.com/erp/devel/pi/rev/5fc5cf465daa
changeset: 13791:5fc5cf465daa
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Sep 19 14:06:30 2011 +0200
summary:   Related to issue 17531: Description field with 2 rows looks nasty in 
grid view
Added ... to truncated string, prevent truncation for hover

diffstat:

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

diffs (40 lines):

diff -r 7e3fb4e2e7d4 -r 5fc5cf465daa 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Mon Sep 19 11:46:47 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Mon Sep 19 14:06:30 2011 +0200
@@ -391,7 +391,7 @@
   },
   
   cellHoverHTML: function(record, rowNum, colNum){
-    var field = this.getField(colNum), cellErrors, msg = '', i;
+    var ret, field = this.getField(colNum), cellErrors, msg = '', i;
     if (this.isCheckboxField(field)) {
       return OB.I18N.getLabel('OBUIAPP_GridSelectColumnPrompt');
     }
@@ -407,7 +407,10 @@
       return record[isc.OBViewGrid.ERROR_MESSAGE_PROP];
     }
     
-    return this.Super('cellHoverHTML', arguments);
+    this.inCellHoverHTML = true;
+    ret = this.Super('cellHoverHTML', arguments);
+    delete this.inCellHoverHTML;
+    return ret;
   },
  
   // also store the filter criteria
@@ -1796,13 +1799,13 @@
   // prevent multi-line content to show strangely
   // https://issues.openbravo.com/view.php?id=17531
   formatCellValue: function(value, record, rowNum, colNum) {
-    if (!isc.isA.String(value)) {
+    if (this.inCellHoverHTML || !isc.isA.String(value)) {
       return value;
     }
   
     var index = value.indexOf('\n');
     if (index !== -1) {
-      return value.substring(0, index);
+      return value.substring(0, index) + '...';
     } 
     return value;
   },

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to