Dear visitor, despite the COVID-19 outbreak, our team continues operating at full speed.

Also, here is the form where you can apply for a special discount and we will contact you with possible options. Stay safe and continue achieving your business goals.

Fill the form
Get Free Trial
Get Free Trial

Trouble with Flexmonster custom filter

Jayita Biswas asked on January 17, 2020

Hi Team,
Flexmonster custom filter(setFilter) is not working when no member attribute array element is not matching with the pivot table data.It should load blank table with message “No data found”. Currently it is loading all the data of pivot table.
Please see the following JSFiddle example:
In this case there is no data with the name of “Customer5”. I have set the “members” attribute with “Customer5”. Then all the data are loading. But if this is changed to “Customer4”. Then only that data is loading and working as expected.
Waiting for a reply.

5 answers

Vera Didenko Flexmonster January 17, 2020

Hello, Jayita,
Thank you for writing to us and for providing a JSFiddle for illustration.
About the members filter behavior:
We would like to explain that currently the members filter gets applied when at least one of the specified members exists in the data set.
If all of the specified members don’t exist, then no members filter is applied. 
Please see the following forum thread for reference.
Our team kindly recommends the following approach:
1) Check if the requested member exists in the data set:
The getMembers() Flexmonster API call can be used to get the list of members of the needed field:
2) If it exists, apply the filter.
3) If not, show a pop-up message instead:
The alert() Flexmonster API call can be used to show the message to the user:
We have prepared a JSFiddle example illustrating the general approach.
Please let us know if this helps.
Best regards,

Jayita Biswas January 20, 2020

Hello Vera,
Thank you for your answer. But is my case Flexmonster pivot table is loading in “Apply” button click. The above JsFiddle example is not working. I have created the following JSFiddle example for your investigation purpose:
Waiting for your reply.

Vera Didenko Flexmonster January 20, 2020

Hello, Jayita,
Thank you for your reply and for providing a JSFiddle for illustration.
This helped us to understand the situation better.
We kindly advise using the reportcomplete event to detect when Flexmonster is rendered and ready to work with.

Please see the modified version of the JSFiddle example:
In this JSFiddle example, the filter is applied when the reportcomplete event is triggered.
Also, we would like to mention that it is possible to use the equal query filter.
Please notice that unlike the members filter, if the searched member does not exist, no data is shown on the grid.

We hope this helps.

Please let us know if this works.
Looking forward to your response.
Best regards,

Jayita Biswas January 22, 2020

Hi Vera,
Thanks for your reply.
The custom filter issue has resolved by using “members” attribute based on a flag. If Customer is contain  in Flexmonster pivot table then only I have used the attribute.Otherwise it will show the popup alert.
Vera can you tell me is there any way to encrypt json data in Flexmonster call? Suppose whatever data Flexmonster pivot table is getting that data will show with encryption in browser Network tab.User can’t see the actual data.

Vera Didenko Flexmonster January 22, 2020

Hello, Jayita,
Thank you for your response.
We are glad to hear that the custom filter works as needed.
As for data encryption:
We would like to confirm that it is possible. Please keep in mind that Flexmonster shows the data in the same way as it is received.
This means data encryption and decryption will need to be handled separately from Flexmonster. 

Our team kindly suggests the following:
1) Encrypt the JSON data on the server-side.
2) Pass the encrypted JSON data to the client-side.
3) Decrypt the JSON data on the client-side.
4) Pass the decrypted JSON data to Flexmonster via the data dataSource object’s property, for example:

dataSource: {
type: "json",
data: getDecryptedJSONData()

We hope this helps.

Please let us know if you have any additional questions.
Best regards,

Please login or Register to Submit Answer