Author Topic: Sort row group in ascending order always.  (Read 2809 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Sort row group in ascending order always.
« on: October 05, 2017, 01:31:47 pm »
Hi Team,

I have 7 fields in my list. 1st field is Status and grouping is applied on it. Sortmodel and Groupmodel looks like this,

sortModel: {
        single: true,
        sorter: [{
          dataIndx: 'Status',
          dir: 'up'
        }],
        space: true,
        multiKey: null
}

var groupModel = {
      on: true,
      dataIndx: ['Status'],
      summaryInTitleRow: 'all',
      titleInFirstCol: true,
      fixCols: false,
      indent: 40,
      collapsed: [false],
      grandSummary: true,
      title: [
        "{0} ({1})",
        "{0} - {1}"
      ]
    };


Clicking on sort enabled field, sorts the row group as well. As required, I want to enable sort on all fields but Row Group (Status) should always be in Ascending order. It should not be sorted on any field sort. How should I do it?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Sort row group in ascending order always.
« Reply #1 on: October 06, 2017, 11:25:55 am »
you can enable multi column sorting that would ensure that status field is sorted on 1st priority.

https://paramquery.com/pro/demos/sorting

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: Sort row group in ascending order always.
« Reply #2 on: October 06, 2017, 04:00:14 pm »
Hi team, Enabling multikey is setting Single to false in sortmodel which will sort only one field on subsequent click on headers. In other words, single false will lock a field sorted. When i click a field and let it in Asc sort mode and try to sort on other fields, do not work. While setting Single to true will remove lock on previous sorted fields and sort according to current field. Can we stop row group sorting?

In image ss1, row is group is sorted in Asc order, But when I sort on Project Name, Row Group (Status) is also sorted. I want Row Group always in Asc order setting Single to true. I dont want to lock sort on any field.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Sort row group in ascending order always.
« Reply #3 on: October 06, 2017, 05:35:14 pm »
Quote
Hi team, Enabling multikey is setting Single to false in sortmodel which will sort only one field on subsequent click on headers.

Please also set sortModel.multiKey to null along with sortModel.single to false. That would ensure sorting on group field is not removed on any subsequent click on any other field in the header.