Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.0
-
Fix Version/s: 1.1
-
Component/s: Paging/Sorting
-
Labels:None
Description
When there is no property and no sortProperty on a column, the rows are sorted using the raw text of the column. The text should be trimmed fefore sorting, else the number of whitespaces before the actual text has an impact on the sort.
For example, if I have a column like this:
<display:column titleKey="entreprises.type"
sortable="true">
<c:choose>
<c:when test="${entreprise.type == 1}">
SARL
</c:when>
<c:when test="${entreprise.type == 2}">
Société
</c:when>
<c:otherwise>
SA
</c:otherwise>
</c:choose>
</display:column>
The first rows are the one with SA, then the ones with Société and finally the ones with SARL, which isn't alphabetically correct. This is just because the number of white spaces is not the same depending on the enterprise type.
For example, if I have a column like this:
<display:column titleKey="entreprises.type"
sortable="true">
<c:choose>
<c:when test="${entreprise.type == 1}">
SARL
</c:when>
<c:when test="${entreprise.type == 2}">
Société
</c:when>
<c:otherwise>
SA
</c:otherwise>
</c:choose>
</display:column>
The first rows are the one with SA, then the ones with Société and finally the ones with SARL, which isn't alphabetically correct. This is just because the number of white spaces is not the same depending on the enterprise type.
DISPL-18