sortOrder not working with options exclude or include

Answered
Igor Macedo asked on October 18, 2024

Currently, we use the sortOrder option to sort some fields in the reports. The attribute works perfectly; however, when we use options like exclude or include together with sortOrder, the sorting stops working correctly.

We use the API datasource in our reports.

We would like to understand why the problem occurs and if there is a way to fix it.

Code works

https://jsfiddle.net/wilson_junior/1sLtjux4/2/

Code not works

https://jsfiddle.net/wilson_junior/1sLtjux4/6/

 

3 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 21, 2024

Hello Igor,

Thank you for contacting us.

Kindly note that the sortOrder property is only available for "csv" and "json" data source types. Alternatively, we recommend using the sortingMethod API call. It defines custom sorting for field members. You are welcome to check our documentation for more details: https://www.flexmonster.com/api/sortingmethod/

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 29, 2024

Hello Igor,

Hope you are having a great week.

We were wondering if you had a chance to check the suggested approach with the sortingMethod API call. Could you please confirm if it works for you?

Looking forward to hearing your feedback.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 5, 2024

Hi Igor!

Hope you are doing well.

Just checking in to ask if you had a chance to check the sortingMethod API call. Could you please confirm if this approach works well for you?

Looking forward to hearing from you.

Kind regards,
Nadia

Please login or Register to Submit Answer