Skip to content

Instantly share code, notes, and snippets.

@mushfiqweb
Created August 14, 2023 11:25
Show Gist options
  • Select an option

  • Save mushfiqweb/77df06c9d667dd2c531a6eee622ac8aa to your computer and use it in GitHub Desktop.

Select an option

Save mushfiqweb/77df06c9d667dd2c531a6eee622ac8aa to your computer and use it in GitHub Desktop.
Elster navigationConfig ISSUE

Hello,

I hope this message finds you well. I wanted to share some feedback regarding the template I recently purchased last week.

Overall, the template seems well-organized and promising. However, I couldn't help but notice that there's an absence of examples showcasing multilevel parent-child menus. The current example in the template only includes a single level of parent-child menu relationships. I've been exploring the navigationConfig and its submenu items, and it appears that when I pass menu items to the submenu array and set the type to NAV_ITEM_TYPE_COLLAPSE for the parent, it creates only one level of nesting.

For clarity, I'm sharing my navigationConfig setup below:

const navigationConfig: NavigationTree[] = [
    {
        key: 'home',
        path: '/home',
        title: 'Home',
        translateKey: 'nav.home',
        icon: 'home',
        type: 'item',
        authority: [],
        subMenu: [],
    },
    {
        key: 'collapseMenu',
        path: '',
        title: 'Collapse Menu',
        translateKey: 'Collapse Menu',
        icon: 'collapseMenu',
        type: 'collapse',
        authority: [],
        subMenu: [
            {
                key: 'collapseMenu.item1',
                path: '/collapse-menu-item-view-1',
                title: 'Collapse menu item 1',
                translateKey: 'Collapse menu item 1',
                icon: '',
                type: 'collapse',
                authority: [],
                subMenu: [
                    {
                        key: 'collapseMenu.item1-child1',
                        path: '/collapse-menu-item-view-1-child-1',
                        title: 'Collapse menu Child Item 1',
                        translateKey: 'Collapse menu Child Item 1',
                        icon: '',
                        type: 'item',
                        authority: [],
                        subMenu: [],
                    },
                    {
                        key: 'collapseMenu.item1--child2',
                        path: '/collapse-menu-item-view-1-child-2',
                        title: 'Collapse menu Child Item 2',
                        translateKey: 'Collapse menu Child Item 2',
                        icon: '',
                        type: 'item',
                        authority: [],
                        subMenu: [],
                    },
                ],
            },
            {
                key: 'collapseMenu.item2',
                path: '/collapse-menu-item-view-2',
                title: 'Collapse menu item 2',
                translateKey: 'Collapse menu item 2',
                icon: '',
                type: 'item',
                authority: [],
                subMenu: [],
            },
        ],
    },
]

Here's what I'm expecting in terms of menu structure:

-- Home
-- Collapse Menu
---- Collapse menu item 1
------ Collapse menu Child Item 1
------ Collapse menu Child Item 2
---- Collapse menu item 2

I hope this clarifies my expectations regarding the multilevel parent-child menu structure. It would be greatly appreciated if you could provide guidance on achieving this hierarchy using the provided template.

Thank you for your assistance and support.

Best regards, [Your Name]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment