Author Topic: how can i sort records within the row group?  (Read 1694 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
how can i sort records within the row group?
« on: September 21, 2017, 04:25:11 pm »
Hi team,

1. how can i sort records within the row group? Please consider the below table. There are two row groups Active and anothe is Inactive. When i click on Rank, all Active records (not the row group) should sort by rank i.e.1,3,5,7 and inactive by 2,4,12.

Status    | project  | rank |
-----------------------
Active    | Project1 | 7      |
Active    | Project2 | 3      |
Active    | Project6 | 5      |
Active    | Project4 | 1      |
Inactive | Project3 | 12    |
Inactive | Project7 | 4      |
Inactive | Project5 | 2      |
------------------------------

Should result as below

Status    | project  | rank |
-----------------------
Active    | Project4 | 1      |
Active    | Project2 | 3      |
Active    | Project6 | 5      |
Active    | Project1 | 7      |
Inactive | Project5 | 2      |
Inactive | Project7 | 4      |
Inactive | Project3 | 12    |
------------------------------

2. how do I swap the records. In above example, rank is a drop down type. In Active row group, when i select 5 and change it 1, this row should move to 1st and 1st should move to 5th withing the Active row group. How do I achieve it?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6265
    • View Profile
Re: how can i sort records within the row group?
« Reply #1 on: September 21, 2017, 09:29:57 pm »
1. Please check the row grouping examples. the column is sorted as per your description by default when row grouping is on.

2. there is no need to swap the records, instead just refresh the sorting by call to method sort().