Pricing changes are coming in January. Contact our Sales team to secure the current price for your desired license.

Filters are removed when there are no results

Answered
leandro f asked on August 13, 2024

When defining a report with a filter that has no results, the filter is removed and all results are displayed. For example:

https://jsfiddle.net/0ohfvnsk/

 

However, when filtering through "Labels > Equal" the filter is maintained and the table does not display results. For example:

https://jsfiddle.net/0ohfvnsk/1/

I would like both cases to work as in the second fiddle, displaying the table without results. How should I do it?

11 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 14, 2024

Hello, Leandro!

Thank you for reaching out to us.

Kindly note that a member filter containing only inexistent members is considered invalid by Flexmonster and, therefore, is not applied. Such a filter can be configured only through the code, and the end-users on the UI can only choose members that are loaded from the data source.
To show an empty grid on an invalid filter, we recommend using the query.equal approach, as in your second example.

Hope you will find our answer helpful.
If there are any further questions, it would be helpful for us to have more details about the use case.

Kind regards,
Solomiia

Public
leandro f August 14, 2024

Hello, in our use case, the client saves the report template containing "slice", "formats", "conditions" and "options". Through a date selector, the client can define which period they want to view and we return a new "dataSource".

What happens is that the client saved their report template filtering by "Product A", but when switching to another month that does not have this product, the filter is removed, causing a bad experience. For example:

https://jsfiddle.net/k910bor7/

We have no control over how the client filters their data, so we would like to keep it even if there are no records of the filtered product. How do we do this?

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 15, 2024

Hello, Leandro!

Thank you for providing more details about your use case.

Please note that considering member filter invalid when there are no such members in the data source is the default filtering behavior in Flexmonster.

We understand why it is important to have an empty grid on the invalid filter in your use case and will research possible solutions to make the filtering behavior more consistent.

Our team will notify you if there are any updates on the matter.
Feel free to contact us if any other questions arise.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 17, 2024

Hello, Leandro!

Hope you are doing well.

Our team is happy to inform you that new filter.allowEmptyMembersFilter option was added. Use this option to show an empty table when the selection filter includes only members that do not exist in the dataset.

We have modified the sample JSFiddle from previous discussion to illustrate the new approach: https://jsfiddle.net/flexmonster/qyuj6ser/.

New option is added to the 2.9.86 version of Flexmonster: https://www.flexmonster.com/release-notes/version-2-9-86/.
You are welcome to update the component: https://www.flexmonster.com/doc/updating-to-the-latest-version/.

Please let us know if the new property works well for you.
Looking forward to hearing from you.

Kind regards,
Solomiia

Public
leandro f September 17, 2024

Hello, thanks for the reply!

This is a really cool feature, I tested it here and it will work for us.

One question, during the tests I noticed that when I tried to "Select all" in order to bring up all the results the filter was not applied, but when I selected one by one the filter worked (.gif attached). Could this be a bug?

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 18, 2024

Hello, Leandro!

Thank you for your feedback. We are glad to hear the new property works well for you.

Regarding the described "Select all" checkbox behavior, we have reproduced it on our side. Our team will fix the inconsistent behavior and get back to you with the update on ETA September 30th.

We will notify you when the fix is ready.

Feel free to reach out to us in case of any other questions.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 2, 2024

Hello, Leandro!

Hope you are having a great week.

Our team is happy to inform you that the issue with the Select all checkbox in the filter view not working when the filter.allowEmptyMembersFilter option is set to true was fixed in the 2.9.87 version of Flexmonster.

You are welcome to update the component: https://www.flexmonster.com/doc/updating-to-the-latest-version/.

Could you please confirm that the new property with this minor fix works fine for you?

Looking forward to hearing your feedback.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 23, 2024

Hello, Leandro!

Hope you are doing well.

Just checking in to ask if the new filter.allowEmptyMembersFilter option works well after the update with the Select all checkbox.

Our team would be happy to hear your feedback.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 30, 2024

Hello, Leandro!

Hope you are having a great week.

Could you please confirm the filter.allowEmptyMembersFilter option works well?

Your feedback is valuable to our team, so we are looking forward to hearing your response.

Best regards,
Solomiia

Public
leandro f October 30, 2024

Hello, thanks for asking. From what I've tested here, the "Select All" button behaves correctly as expected.

We haven't been able to prioritize this change in our product yet, but I'll get in touch if it doesn't meet our needs.

Thank you.

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 31, 2024

Hello, Leandro!

Thank you for the confirmation.

We are glad to hear everything works well.

Do not hesitate to reach out to us if any further questions arise.

Kind regards,
Solomiia

Please login or Register to Submit Answer