diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js index c33344f1a0a5ac0117848952a3a973182920e3b1..34b9b0da48c707ee4bf6cc93d7edeed324d5d2f3 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js @@ -335,21 +335,39 @@ $.extend(Grid.prototype, { renderData : function(dataList) { var thisGrid = this; var items = []; - var maxLineLength = 300; + var maxLineLength = 200; dataList.forEach(function(data) { var item = {}; thisGrid.getVisibleColumns().forEach(function(column) { + //1. Render var value = null; if (column.render) { value = column.render(data); } else { value = data[column.property]; - if(value && value.length > maxLineLength) { - value = value.substring(0, maxLineLength) + "..."; - } } - item[column.property] = FormUtil.sanitizeRichHTMLText(value); + + //2. Sanitize + var value = FormUtil.sanitizeRichHTMLText(value); + + //3. Shorten + var finalValue = null; + if(value && value.length > maxLineLength) { + finalValue = value.substring(0, maxLineLength) + "..."; + } else { + finalValue = value; + } + + //4. Tooltip + if(value !== finalValue) { + finalValue = $("<div>").append(finalValue); + finalValue.tooltipster({ + content: $(value) + }); + } + + item[column.property] = finalValue; }); items.push(item); });