Good afternoon,
I'm having an issue with the sorting toggle button in Flexmonster. My data is returned unsorted on page load, but when I click the cog icon to change the sorting, the AZ button is already selected, even though my data is not sorted yet. If I click "OK" to close the dialog and apply the AZ sorting, nothing changes.
To sort by AZ, I need to open the dialog, click to sort by ZA, and then click AZ again to activate the sorting option correctly. This behavior is very strange and is confusing to the users.
This bug occurs in the Flexmonster demo fiddle. Follow these steps to reproduce:
Expected behavior: After closing the dialog, the data should be sorted as selected.
Hello, Lucas!
Thank you for reaching out to us.
Kindly note that in the provided example, there is an explicitly set value filter applied to the Price measure, which has higher priority than the inexplicitly set our default members sorting:
sorting: {
column: {
type: "desc",
tuple: [],
measure: {
uniqueName: "Price",
aggregation: "sum",
},
},
},
If we remove the value sorting, the members are sorted AZ by default: https://jsfiddle.net/flexmonster/Ltx7v91g/.
We recommend explicitly setting the default sorting for members where necessary to avoid any confusion: https://www.flexmonster.com/doc/sorting/#set-order.
Hope you will find our answer helpful.
Kind regards,
Solomiia
Hello Solomiia!
I understand what you mean. However, I still need the component to continue displaying the initial sorting in a different way. What isn’t clear is that when the filter popup is opened, the data is displayed in the correct "AZ" order, but if I click OK, the data isn’t filtered, which causes confusion for the users.
fiddle: https://jsfiddle.net/sxje150n/6/
Here are some images explaining the issue:
1 - Initial state after page load
2 - I clicked the settings icon next to the "country" category, and the popup opened. Notice that the data displayed in the popup is already filtered as "AZ," and the "AZ" toggle is checked.
3 - After clicking "apply," the data remains as it was before. However, the popup indicated that the data would be filtered. This behavior doesn’t seem correct.
So, am I understanding correctly that if there’s already a filter applied in the slice object, then the changes on the screen stop working?
Thank you for the help!
Hello, Lukas!
Thank you for getting back to us.
Yes, you understand correctly. If data is sorted by values, the sorting has more priority than the asc/desc members sorting. Sorting by values is also present on the UI, in our case, it's the sorting arrow in the "Total Sum of Price" cell. Sorting on the grid can be cleared using the context menu.
Our team agrees that applying the AZ/ZA sorting on the Apply button click sounds reasonable. We have prepared a JSFiddle that removes the value sorting if the filter is applied with active AZ/ZA sorting: https://jsfiddle.net/flexmonster/tmhzeok4/.
Hope it helps.
Kind regards,
Solomiia