Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Blama
    replied
    Hi mgallagher, Hi edulid,

    please see also this thread for an enhancement coming in 5.1 regarding the limitation edulid mentioned.

    Best regards,
    Blama

    Leave a comment:


  • edulid
    replied
    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.
    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.

    Leave a comment:


  • mgallagher
    replied
    Originally posted by Blama View Post
    Hi mgallagher,

    see ListGridField.setSortNormalizer().

    Best regards,
    Blama
    Perfect, that worked a treat!

    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:


  • Blama
    replied
    Hi mgallagher,

    see ListGridField.setSortNormalizer().

    Best regards,
    Blama

    Leave a comment:


  • edulid
    replied
    You can create an invisible column with values derived from the real value: "0Low", "1Med", "2High". Then sort by this column.

    Leave a comment:


  • mgallagher
    started a topic Sort ListGrid Records by cell attribute

    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?
Working...
X