Please give a brief summary of your issue: I want to create sub-menu inside the view, just like we have in annotation and shapes.
(Think of this as an email subject)
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Please provide a link to a minimal sample where the issue is reproducible:
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
To create a sub-menu in the view control similar to the annotation and shapes menu in Apryse’s WebViewer, you can utilize the Flyout component in the Modular UI. Flyouts allow you to create toggleable menus containing nested items, which can be used to build submenus.
Some things you can try:
Create a Flyout using the UI.Components.Flyout class for your view control.
Add items to the Flyout, including nested items for submenus using the children property.
Integrate the Flyout into your application using the UI.Flyouts.addFlyouts method.
Customize the icons and onClick behaviors for each menu item.
Basically, a header contains one or more grouped items. You should find a grouped item you want to add the new button and set it’s items.
This is an example of adding a custom button to the forms group. You can modify it to add to the new custom next to view.
// Getting the header that we want to add the button
const toolsHeader = instance.UI.getModularHeader('tools-header');
const toolsHeaderGroupedItems = toolsHeader.getGroupedItems();
// Getting the forms grouped items
const formsGroupedItems = toolsHeaderGroupedItems[8];
// Inside of this grouped item we have another grouped item with the tools:
const formToolsGroupedItems = formsGroupedItems.items[0];
// adding the "customToolButton" as the last item of the tools
// @ts-ignore
formToolsGroupedItems.setItems([...formToolsGroupedItems.items, customToolButton]);