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: https://jsfiddle.net/biswasjayita2011/jL1rvy72/32/.
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.
Thank you for writing to us and for providing a JSFiddle for illustration.
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:
getMembers() Flexmonster API call can be used to get the list of members of the needed field: https://www.flexmonster.com/api/getmembers/
2) If it exists, apply the filter.
3) If not, show a pop-up message instead:
alert() Flexmonster API call can be used to show the message to the user: https://www.flexmonster.com/api/alert/
We have prepared a JSFiddle example illustrating the general approach.
Please let us know if this helps.
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.
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: https://jsfiddle.net/flexmonster/vfsumeq9/
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.
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.
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
dataSource object’s property, for example:
We hope this helps.
Please let us know if you have any additional questions.