Is it possible to use a!sortInfo to sort by field1 and then by field2?

Is it possible to use a!sortInfo to sort by field1 and then by field2?

I tried the following code, but I am getting an error " Invalid Cast: Cannot cast from type 'PagingInfo' to type 'Date': CastInvalid"

a!sortInfo({
{field:"field1",ascending:false)},
{field:"field2",ascending:false)}
})

OriginalPostID-141868

OriginalPostID-141868

  Discussion posts and replies are publicly visible

Parents
  • Putting multiple sort on todatasubset will not help to get records sorted correctly as todatasubset() does operation on already fetched data which is in memory and I guess multiple sort should be done on actual database table/entity directly rather than already fetched data.

    In my case I need to have data sorted based on multiple fields from a table having 1000s of records and my paging size is 10 only. In this case putting multiple sorts on todatasubset wont help, please correct me on this.
Reply
  • Putting multiple sort on todatasubset will not help to get records sorted correctly as todatasubset() does operation on already fetched data which is in memory and I guess multiple sort should be done on actual database table/entity directly rather than already fetched data.

    In my case I need to have data sorted based on multiple fields from a table having 1000s of records and my paging size is 10 only. In this case putting multiple sorts on todatasubset wont help, please correct me on this.
Children
No Data