Skip to content
Snippets Groups Projects
Commit d44d4a2e authored by juanf's avatar juanf
Browse files

SSDM-3292 : Tables now show the text wrapped and cut it when size is bigger than 300 chars.

SVN: 35837
parent 0cb0842a
No related branches found
No related tags found
No related merge requests found
...@@ -79,11 +79,26 @@ var ExperimentDataGridUtil = new function() { ...@@ -79,11 +79,26 @@ var ExperimentDataGridUtil = new function() {
var newVocabularyColumnFunc = getVocabularyColumn(propertyType); var newVocabularyColumnFunc = getVocabularyColumn(propertyType);
propertyColumnsToSort.push(newVocabularyColumnFunc()); propertyColumnsToSort.push(newVocabularyColumnFunc());
} else { } 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({ propertyColumnsToSort.push({
label : propertyCodesDisplayNames[idx], label : propertyCodesDisplayNames[idx],
property : propertyCodes[idx], property : propertyCodes[idx],
isExportable: true, isExportable: true,
sortable : true sortable : true,
render : getRenderFunction(propertyType)
}); });
} }
} }
......
...@@ -136,11 +136,26 @@ var SampleDataGridUtil = new function() { ...@@ -136,11 +136,26 @@ var SampleDataGridUtil = new function() {
var newVocabularyColumnFunc = getVocabularyColumn(propertyType); var newVocabularyColumnFunc = getVocabularyColumn(propertyType);
propertyColumnsToSort.push(newVocabularyColumnFunc()); propertyColumnsToSort.push(newVocabularyColumnFunc());
} else { } 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({ propertyColumnsToSort.push({
label : propertyCodesDisplayNames[idx], label : propertyCodesDisplayNames[idx],
property : propertyCodes[idx], property : propertyCodes[idx],
isExportable: true, isExportable: true,
sortable : true sortable : true,
render : getRenderFunction(propertyType)
}); });
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment