Hi mgallagher, Hi edulid,
please see also this thread for an enhancement coming in 5.1 regarding the limitation edulid mentioned.
Best regards,
Blama
Announcement
Collapse
No announcement yet.
X
-
It works, but note this. If you got more than 75 records (or dataPageSize), this will not work, since the server will be in charge of the sorting.Note that, if the dataset exceeds dataPageSize and hence paging is introduced, the grid relies on the server to provide sorting, and the sortNormalizer will no longer be called.
Leave a comment:
-
Perfect, that worked a treat!Originally posted by Blama View Post
Here is the code if anyone cares:
Code:severityField.setSortNormalizer(new SortNormalizer() { @Override public Object normalize(ListGridRecord record, String fieldName) { String highMedLow = record.getAttribute("AttributeName"); Integer returnValue = 0; returnValue = "HIGH".equalsIgnoreCase(highMedLow) ? 1000 : returnValue; returnValue = "MED".equalsIgnoreCase(highMedLow) ? 100 : returnValue; returnValue = "LOW".equalsIgnoreCase(highMedLow) ? 10 : returnValue; return returnValue; } });
Leave a comment:
-
-
You can create an invisible column with values derived from the real value: "0Low", "1Med", "2High". Then sort by this column.
Leave a comment:
-
Sort ListGrid Records by cell attribute
Hey all,
I have a list grid and one of the columns will contain the values {LOW, MED, HIGH}, when I attempt to sort this column it does it alphabetically.
Is there anyway I can specify my own sorting algorithm for the column?Tags: None
Leave a comment: