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 ae53e20ad46ebe95172d3edf494d55d1bb71fe7a..8d0608b21168ef4fe533b559cbb3a5bba9416c1f 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,11 +79,26 @@ 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 + sortable : true, + render : getRenderFunction(propertyType) }); } } 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 18866b04aaec60e36975e760263ded5748622489..8bfc427a2169f00d7e367f0bfe08a3b9f34d2305 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 @@ -136,11 +136,26 @@ 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; + } + } + propertyColumnsToSort.push({ label : propertyCodesDisplayNames[idx], property : propertyCodes[idx], isExportable: true, - sortable : true + sortable : true, + render : getRenderFunction(propertyType) }); } }