Announcement

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

    SortDirection for SortNormalizer

    Hi again!

    First I want to describe you want I want to achieve in order to better understand my need.
    I have a ListGrid with let's say 5 records and at the end of these 5 records i want to have 20 empty lines(records). No problem with this because I already managed it. These 20 empty lines become a problem when I want to sort a column and I want to always keep them below that 5 records. After browsing the forum and the documentation I found out that I can use a SortNormalizer.

    Good news until I wanted to find out in which direction the grid(column) WILL BE SORTED in order to return the corresponding value from the normalize() function. In the normalize() function if I ask the column to give me the sorting direction it will give me the current one and not the one that is going to be sorted so I am always one step behind.
    For example let's say that column B has a SortNormalizer, it is sorted ASCENDING and the user clicks the header to sort the column DESCENDING. The normalize function of the SortNormalizer is called and if I want to always keep those 20 records at the bottom I have to return for them the lowest possible value. The real problem is that if I ask the column to give me its sorting order it will give me ASCENDING(previous order) and not DESCENDING(current order).

    One quick solution is to add a new parameter to the normalize function and to become
    normalize(ListGridRecord record, String fieldName, SortDirection direction)

    Hope you understood my problem and waiting for your always prompt response.
    Best regards,
    Andrei
Working...
X