diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index 39f12f7cf98f8bca1ef7788be73d1947ac3b5241..7d6d0fb1fc8242aebe6d5028b7a8d98d52a30a96 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -722,7 +722,7 @@ function MainController(profile) { permId : sample.permId, code : sample.code, sampleTypeCode : sample.sampleTypeCode, - matched : $container + matched : $container[0].outerHTML }); } diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js index 8d0608b21168ef4fe533b559cbb3a5bba9416c1f..ae53e20ad46ebe95172d3edf494d55d1bb71fe7a 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js @@ -79,26 +79,11 @@ var ExperimentDataGridUtil = new function() { var newVocabularyColumnFunc = getVocabularyColumn(propertyType); propertyColumnsToSort.push(newVocabularyColumnFunc()); } else { - var maxLineLength = 300; - var getRenderFunction = function(propertyType) { - return function(data) { - var propValue = data[propertyType.code]; - if(propValue) { - propValue = propValue.substring(0, maxLineLength); - if(data[propertyType.code].length > maxLineLength) { - propValue += "..."; - } - } - return propValue; - } - } - propertyColumnsToSort.push({ label : propertyCodesDisplayNames[idx], property : propertyCodes[idx], isExportable: true, - sortable : true, - render : getRenderFunction(propertyType) + sortable : true }); } } diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js index 8349321e516246930ebd465fcf2330a01d1c98c8..0ddf7a25aaf30e488882a6de6b45b2d86f59ea1e 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js @@ -135,27 +135,12 @@ var SampleDataGridUtil = new function() { var newVocabularyColumnFunc = getVocabularyColumn(propertyType); propertyColumnsToSort.push(newVocabularyColumnFunc()); - } else { - var maxLineLength = 300; - var getRenderFunction = function(propertyType) { - return function(data) { - var propValue = data[propertyType.code]; - if(propValue) { - propValue = propValue.substring(0, maxLineLength); - if(data[propertyType.code].length > maxLineLength) { - propValue += "..."; - } - } - return propValue; - } - } - + } else { propertyColumnsToSort.push({ label : propertyCodesDisplayNames[idx], property : propertyCodes[idx], isExportable: true, - sortable : true, - render : getRenderFunction(propertyType) + sortable : true }); } } 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 a8bc475d038584dbdcf433014462ecdef852fc52..c33344f1a0a5ac0117848952a3a973182920e3b1 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,7 +335,8 @@ $.extend(Grid.prototype, { renderData : function(dataList) { var thisGrid = this; var items = []; - + var maxLineLength = 300; + dataList.forEach(function(data) { var item = {}; thisGrid.getVisibleColumns().forEach(function(column) { @@ -344,6 +345,9 @@ $.extend(Grid.prototype, { 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); });