Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Showing custom error messages for flexmonster with elasticsearch

amir asked on March 19, 2021

How can I show custom error message for my flexmonster chart with elasticsearch if my elasticsearch index is not available (or say elasticsearch server is down) instead of just showing default Error alert box  


3 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster March 19, 2021

Thank you for contacting us.
We suggest using the olapstructureerror event in combination with the alert API call to handle some of these scenarios.
Our team prepared the JSFiddle to demonstrate this approach:
Please let us know if it works well for your case.
We are looking forward to hearing from you.
Best regards,

amir March 20, 2021

Yes, thank you this worked.
 What are the other cases (apart from not loading elasticsearch index), this event will get triggered??? There is not much detail about this in docs. I am concerned because i have different kind of flexmonster charts and grids in my application. i want to restrict this to charts usinig elasticsearch 

Illia Yatsyshyn Illia Yatsyshyn Flexmonster March 22, 2021

Thank you for your feedback. We are happy to hear this works well for you.
The olapstructureerror event is only triggered if any errors appear while loading the structure of the Elasticsearch index. It implies the unavailability of the index itself.
If we understand correctly, your concerns are that this event may be triggered in an unexpected or unwanted situation. If so, we would like to confirm that this event is only triggered under the circumstances mentioned earlier.
Also, if you want to use this event only for some Flexmonster instances (for example, only for the ones displaying charts), in that case, we suggest subscribing to this event using the corresponding reference to the instance.

let pivot = new Flexmonster({

pivot.on('olapstructureerror', function(e) {

We hope it works.
If we did not understand some parts of your question in the right way, please provide further details or illustrations.
Best regards,

Please login or Register to Submit Answer