This is a migrated thread and some comments may be shown as answers.

Sorting Issues

1 Answer 63 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Veteran
Lee asked on 12 Apr 2018, 10:00 AM

Hi,

I have Multiple Column and Rows fields.

  • Column: Year (i.e 2018, stored as a int (tried DateTime and String also) and Month (i.e April, stored as DateTime)
  • Row: Name (i.e. Lee Stevens, stored as String) and Charge Type (i.e. Annual Leave, stored as String)

Now, when i sort ONLY the columns OR row, the results display as they should but when i want to Sort from both it "can't" I guess and gives up.

 

For example when i sort the Column (Year, Month)

sort: [
    {
        field: "Year",
        dir: "desc" //or asc
    },
    {
        field: "Month",
        dir: "asc" //or asc
    }
]

This work perfectly fine, It display the Year(s) (i.e. 2018, 2017, 2016) then the Months in order (I.e. Jan, Feb, March)

 

But as soon as i introduce the sorting the row also they then stop ordering correctly:

sort: [
    {
        field: "FullName",
        dir: "asc" //or asc
    },
    {
        field: "Year",
        dir: "desc" //or asc
    },
    {
        field: "Month",
        dir: "asc" //or asc
    }
]

The order becomes: 2017, 2019, 2018. Nov, Dec, April, Jan (they seem to loose there sorting?)

Any ideas?

Thanks,
Lee.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 16 Apr 2018, 06:43 AM
Hello Lee,

The PivotGrid has its limitations when it is bound to flat data and sorting is one of them:
If you want to take advantage of all PivotGrid features you need to use OLAP binding instead.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
PivotGrid
Asked by
Lee
Top achievements
Rank 1
Veteran
Answers by
Konstantin Dikov
Telerik team
Share this question
or