We have changed our pricing. Flexmonster Software License Agreement was also updated (list of changes)

Issue with sorting toggle behavior in Flexmonster filter dialog

Answered
Lucas Cercal asked on November 28, 2024

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:

  1. Open the example fiddle: https://jsfiddle.net/flexmonster/rkprvhhs/
  2. Click the cog icon in the "Country" cell configuration.
  3. After the dialog opens, note that the AZ sorting option is already checked.
  4. Click "OK" to apply the sorting.
  5. The sorting order will not change.

Expected behavior: After closing the dialog, the data should be sorted as selected.

7 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster November 29, 2024

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/#overriding-default-sort-order.

Hope you will find our answer helpful.

Kind regards,
Solomiia

 

Public
Lucas Cercal December 2, 2024

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!

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster December 4, 2024

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

 

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster December 12, 2024

Hello, Lukas!

Hope you are doing well.

Our team is wondering if you had some time to check the suggested workaround with applying AZ/ZA sorting. Could you please let us know if it works well for you?

Looking forward to hearing your feedback.

Kind regards,
Solomiia

 

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster December 19, 2024

Hello, Lukas!

Hope everything is well.

Just checking in to ask if the suggested workaround with applying AZ/ZA sorting works well for you.

Looking forward to hearing your response.

Kind regards,
Solomiia

 

Public
Lucas Cercal December 19, 2024

Hi Solomiia!

I apologize for the delay in responding.

The suggested solution resolves the issue, but I don’t believe it is the correct approach. I’m using Flexmonster in a Vue project, and frequently manipulating the DOM for these implementations impacts performance.

I managed to work around the issue by guiding the user to take an additional step when using the tool, which I believe is also not the right solution. In my opinion, this issue is a bug and should be solved directly in the Flexmonster library.

Kind regards.

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster December 20, 2024

Hello, Lukas!

Thank you for your feedback.

Kindly note that in Flexmonster, value sorting has a higher priority than members sorting by design. When there is no value sorting on the grid, the members sorting works as expected by you. If your use case requires clearing value sorting when members sorting is applied, you are welcome to use any suitable workaround.

Hope it helps.

Kind regards,
Solomiia

 

Please login or Register to Submit Answer