[Vtigercrm-commits] [vtiger-commits] r9595 - /vtigercrm/branches/5.0.1/include/js/dtlviewajax.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Oct 9 03:05:21 EDT 2006


Author: richie
Date: Mon Oct  9 01:05:17 2006
New Revision: 9595

Log:
code contribution for multiselect combo box integrated  --Minnie

Modified:
    vtigercrm/branches/5.0.1/include/js/dtlviewajax.js

Modified: vtigercrm/branches/5.0.1/include/js/dtlviewajax.js
==============================================================================
--- vtigercrm/branches/5.0.1/include/js/dtlviewajax.js (original)
+++ vtigercrm/branches/5.0.1/include/js/dtlviewajax.js Mon Oct  9 01:05:17 2006
@@ -314,6 +314,23 @@
 		}
 	}else if(uitype == '33')
   	{
+		/* Wordwrap a long list of multi-select combo box items at the
+                 * item separator string */
+                const DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl.
+
+                var lineLength = 0;
+                for(var i=0; i < r.length; i++) {
+                        lineLength += r[i].length + 2; // + 2 for item separator string
+                        if(lineLength > DETAILVIEW_WORDWRAP_WIDTH && i > 0) {
+                                lineLength = r[i].length + 2; // reset.
+                            r[i] = '<br/>&nbsp;' + r[i]; // prepend newline.
+                        }
+                        // Prevent a browser splitting multiword items:
+                        r[i] = r[i].replace(/ /g, '&nbsp;');
+                }
+                /* Join items with item separator string (which must match string in DetailViewUI.tpl,
+                 * EditViewUtils.php and CRMEntity.php)!!
+                 */
        		getObj(dtlView).innerHTML = r.join(", ");
 	}else
 	{





More information about the vtigercrm-commits mailing list