We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Custom Sorting is not working for 'Member' with custom data source API

Answered
Parmod asked on October 6, 2020

Hi, there is some issue is flexmonster custom data source API
my 'members' request response is:

//Field response
{
"fields": [
{
"uniqueName": "Custom Day Of Week",
"type": "string",
"caption": "Custom Day Of Week"
},
{
"uniqueName": "Custom Month",
"type": "string",
"caption": "Custom Month"
},
{
"uniqueName": "Weight",
"type": "number",
"caption": "Weight"
}
],
"aggregations": {
"any": [
"count",
"distinctcount"
],
"date": [
"count",
"distinctcount",
"min",
"max"
],
"number": [
"sum",
"average",
"count",
"distinctcount",
"min",
"max"
]
},
"filters": {
"date": {
"members": true,
"query": [
"equal",
"not_equal",
"after",
"after_equal",
"before",
"before_equal",
"between",
"not_between",
"last",
"current",
"next"
],
"valueQuery": [
"equal",
"not_equal",
"greater",
"greater_equal",
"less",
"less_equal",
"between",
"not_between"
]
},
"number": {
"members": true,
"query": [
"equal",
"not_equal",
"greater",
"greater_equal",
"less",
"less_equal",
"between",
"not_between"
],
"valueQuery": [
"equal",
"not_equal",
"greater",
"greater_equal",
"less",
"less_equal",
"between",
"not_between"
]
},
"string": {
"members": true,
"query": [
"equal",
"not_equal",
"begin",
"not_begin",
"end",
"not_end",
"contain",
"not_contain",
"greater",
"greater_equal",
"less",
"less_equal",
"between",
"not_between"
],
"valueQuery": [
"equal",
"not_equal",
"greater",
"greater_equal",
"less",
"less_equal",
"between",
"not_between"
]
},
"advanced": true
}
}
// 1st members response
{
"members": [
{
"value": "January",
"id": "1"
},
{
"value": "July",
"id": "7"
},
{
"value": "August",
"id": "8"
},
{
"value": "September",
"id": "9"
},
{
"value": "December",
"id": "12"
}
],
"sorted": true,
"page": 0,
"pageTotal": 1
}
//2nd memmbers response
{
"members": [
{
"value": "Sunday",
"id": "0"
},
{
"value": "Monday",
"id": "1"
},
{
"value": "Tuesday",
"id": "2"
},
{
"value": "Wednesday",
"id": "3"
},
{
"value": "Thursday",
"id": "4"
},
{
"value": "Friday",
"id": "5"
},
{
"value": "Saturday",
"id": "6"
}
],
"sorted": true,
"page": 0,
"pageTotal": 1
}

From server I'm sending the value of 'sorted' as true.
Still on the client(flexmonsterjs) the member are shown as alpha-sorted

Please see the attach screenshot.

Attachments:
SortingProblem..PNG

6 answers

Public
Vera Didenko Vera Didenko Flexmonster October 7, 2020

Hello, 
 
Thank you for reaching out to us. 
 
We would like to confirm that this is not the expected behavior: if sorted is set as true, the members’ order from the response should be used as AZ order on the UI.
Our team will provide the fix to this issue in the minor release version with the ETA 2nd of November.
 
In the meantime, as a workaround, we kindly suggest setting the defaultHierarchySortName option to "unsorted", for example:

var pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
options: {
defaultHierarchySortName: "unsorted"
},
dataSource: {...}
...
}
});

 
Please let us know if this works for you.
Looking forward to your response. 
 
Kind regards, 
Vera

Public
Parmod October 7, 2020

thank you!, I have already tried setting the defaultHierarchySortName option earlier to "unsorted". It worked 90 percent as expected.

Public
Vera Didenko Vera Didenko Flexmonster November 2, 2020

Hello,
 
We are glad to inform you that the issue with ignoring sorted: true in the members request was fixed.
 
This is available in the latest version of Flexmonster: https://www.flexmonster.com/release-notes/.
You are welcome to update the component.
 
 
Please let us know if everything works fine for you.
Looking forward to your feedback.
 
Kind regards, 
Vera

Public
Vera Didenko Vera Didenko Flexmonster November 10, 2020

Hello, 
 
Just checking in to ask whether you received our notification regarding the fix.
Did the update help to fix the issue on your side?
 
We would be happy to hear your feedback.
 
Kind regards, 
Vera

Public
Vera Didenko Vera Didenko Flexmonster November 17, 2020

Hello, 
 
Our team is wondering if the recent fix helped to resolve the issue on your end.
Does everything work fine for you?
 
We would be happy to hear from you.
 
Kind regards, 
Vera

Public
Parmod March 11, 2021

Hi Vera,

The sorting is working as expected.

Thankyou.

Regards,
Parmod

Please login or Register to Submit Answer