/
Create Menu and sub-menus
Convertigo Public Knowledge base
Create Menu and sub-menus
To make sub-menus, MenuAutoItems component can not be used, it has to be done “manually”.
Most of the Palette components can be used to create Menu and Sub-menus (Grid, List items, Buttons, Icons, Accordion Group, …).
The Accordion Group component is likely to be the most useful one.
Here is an example :
You can think of a more sophisticated and complex menus using code to automatically retrieve pages name and build menu and sub-menus with a ForEach Directive:
let pages = this.router.pagesArray; // Function that returns an Array of Pages with their properties
// Function that returns the name of the active page.
// In 'Edit Application class' or in 'Edit Page class'
public getActivePage() {
let url = this.angularRouter.routerState.snapshot.url;
console.log("current url is: ", url)
for (let page of this.appPages) {
if (url.substring(1).startsWith(page["url"])) {
console.log("active page is: ", page["name"])
return page["name"]
}
}
return ""
}
With this helper functions you can build an automatic menu and sub-menus.
Related content
How to use Segment Container component
How to use Segment Container component
More like this
Call class page function from element Event
Call class page function from element Event
More like this
Custom ActionSheet Controller
Custom ActionSheet Controller
More like this
Use multiple menus in a Page
Use multiple menus in a Page
More like this
Passing parameters to a page
Passing parameters to a page
More like this
Reusable "HTML" on multiple pages
Reusable "HTML" on multiple pages
More like this
(c) Convertigo 2023 https://www.convertigo.com