Get Free Trial

How to add toolbar tab menu items programmatically

Andrey asked on November 10, 2020

Hi Team,
When we “Save” a new custom report we prompt the user to name it before saving. We are looking for a way to add the report names to the dropdown menu of the “Open” toolbar tab at the same time. Your documentation shows examples of customizing toolbar using beforetoolbarcreated. In our case the toolbar is already created. We just want to dynamically add menus to the tab. How can we achieve that?
Thank you,

3 answers

Mykhailo Halaida Mykhailo Halaida Flexmonster November 12, 2020

Hi Andrey,
Thank you for posting your question.
Please note that the default Flexmonster toolbar wasn’t designed to be modified on the run – instead, the available customization through the beforetoolbarcreated event handler allows you to adjust the toolbar to your needs before it is rendered.
In case you need to be able to modify the tabs at runtime, we would suggest implementing your own toolbar/another UI element that would provide access to the necessary functionality, while also being modifiable on the run.
Everything that the default toolbar does is available through the Flexmonster API calls, meaning you will have no issues linking the required functionality to your own toolbar implementation.
Please let us know if this helps.
Best regards,

Andrey November 12, 2020

Hi Mykhailo,
Thank you for providing the explanation, it’s very helpful. I also figured recreating a Flexmonster Pivot Table instance does the job of recreating the toolbar with new menus. That should do it for us.

Mykhailo Halaida Mykhailo Halaida Flexmonster November 13, 2020

Hi Andrey,
Thank you for the update – we’re glad you’ve found a solution that works for you!
Feel free to reach out if there is anything else we can help you with.

Please login or Register to Submit Answer