Multi-level Treeview Menu does not work in Adminlte

Asked

Viewed 1,042 times

1

Problem:

I’m using the template Adminlte 2 (very good template! ) in the project that uses the Framework Laravel. I was able to include all the files and configure the layout to be displayed on Sidebar and everything works fine. However, the child menu item that should be expanded when the parent menu is triggered, does not work and also the minimizing of the Sidebar is not working.

The following image presents the problem, While trying to open the menu of "Cadastrals" or try to minimise the "Sidebar" from the screen of "Projects" these features do not work and appears in the URL the symbol "#".

inserir a descrição da imagem aqui
Devtools: network and console tabs


inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

Exceptions: But if I try to minimize the Sidebar and expand the registration menu from the Dashboard screen these features work perfectly, follow the images.

Sidebar minimized inserir a descrição da imagem aqui

Expanded registration menu inserir a descrição da imagem aqui I don’t know what to do really. Please, I need help. I have looked for a difficult solution for weeks and found nothing to help.

File: adminlte.php configure the template Sidebar

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Title
    |--------------------------------------------------------------------------
    |
    | The default title of your admin panel, this goes into the title tag
    | of your page. You can override it per page with the title section.
    | You can optionally also specify a title prefix and/or postfix.
    |
    */

    'title' => '',

    'title_prefix' => '',

    'title_postfix' => '',

    /*
    |--------------------------------------------------------------------------
    | Logo
    |--------------------------------------------------------------------------
    |
    | This logo is displayed at the upper left corner of your admin panel.
    | You can use basic HTML here if you want. The logo has also a mini
    | variant, used for the mini side bar. Make it 3 letters or so
    |
    */



     'logo' => '<img src="/img/Logo-UNION.png" alt="Union"  height="40px" width="70px">',

    // 'logo_mini' => É exibido quando o menu é minimizado
     'logo_mini' => '<img src="/img/Icon-UNION.png" alt="Union"  height="35px" width="25px">',


    /*
    |--------------------------------------------------------------------------
    | Skin Color
    |--------------------------------------------------------------------------
    |
    | Choose a skin color for your admin panel. The available skin colors:
    | blue, black, purple, yellow, red, and green. Each skin also has a
    | ligth variant: blue-light, purple-light, purple-light, etc.
    |
    */

    'skin' => 'blue',

    /*
    |--------------------------------------------------------------------------
    | Layout
    |--------------------------------------------------------------------------
    |
    | Choose a layout for your admin panel. The available layout options:
    | null, 'boxed', 'fixed', 'top-nav'. null is the default, top-nav
    | removes the sidebar and places your menu in the top navbar
    |
    */

    'layout' => null,

    /*
    |--------------------------------------------------------------------------
    | Collapse Sidebar
    |--------------------------------------------------------------------------
    |
    | Here we choose and option to be able to start with a collapsed side
    | bar. To adjust your sidebar layout simply set this  either true
    | this is compatible with layouts except top-nav layout option
    |
    */

    'collapse_sidebar' => false,

    /*
    |--------------------------------------------------------------------------
    | URLs
    |--------------------------------------------------------------------------
    |
    | Register here your dashboard, logout, login and register URLs. The
    | logout URL automatically sends a POST request in Laravel 5.3 or higher.
    | You can set the request to a GET or POST with logout_method.
    | Set register_url to null if you don't want a register link.
    |
    */

    'dashboard_url' => 'dashboard',

    'logout_url' => 'logout',

    'logout_method' => null,

    'login_url' => 'login',

    'register_url' => 'register',

    /*
    |--------------------------------------------------------------------------
    | Menu Items
    |--------------------------------------------------------------------------
    |
    | Specify your menu items to display in the left sidebar. Each menu item
    | should have a text and and a URL. You can also specify an icon from
    | Font Awesome. A string instead of an array represents a header in sidebar
    | layout. The 'can' is a filter on Laravel's built in Gate functionality.
    |
    */

    'menu' => [
        'PRINCIPAL',

        [
            'text'        => 'Dashboard',
            'url'         => 'dashboard',
            'icon'        => 'tachometer',
            // 'label'       => ,
           // 'label_color' => 'success',
        ],
        'ADMINISTRATIVO',
        [
            'text' => 'Projetos',
            'url'  => 'projetos/projeto',
            'icon' => 'archive',
        ],
        'CADASTROS',
        [
            'text' => 'Cadastros',
            'icon' => 'file',
            'submenu' => [
                [
                    'text' => 'Categoria do Instrumento',
                    'url'  => 'categoriaInstrumentos/categoriaInstrumento',
                ],
                [
                    'text'  => 'Checklist de Modelos',
                    'url'   => 'checklistsModelos/checklistModelo',
                ],
                [
                    'text'  => 'Checklist de Itens',
                    'url'   => 'checklistsItens/checklistItem',
                ],
              /*   [
                    'text'  => 'Checklist de Estrutura',
                    'url'   => 'checklistsEstruturas/checklistEstrutura',
                ], */
                [
                    'text'  => 'Elemento de Despesa',
                    'url'   => 'elementosDespesas/elementoDespesa',
                ],
                [
                    'text'  => 'Fonte de Recurso',
                    'url'   => 'fontesRecursos/fonteRecurso',
                ],
                [
                    'text'  => 'Localidade',
                    'url'   => 'localidades/localidade',
                ],
                [
                    'text'  => 'Modalidade de Apoio',
                    'url'   => 'modalidadesApoios/modalidadeApoio',
                ],
                [
                    'text'  => 'Modalidade de Licitação',
                    'url'   => 'modalidadesLicitacoes/modalidadeLicitacao',
                ],
                [
                    'text'  => 'País',
                    'url'   => 'paises/pais',
                ],
                [
                    'text'  => 'Projeto de Atividade',
                    'url'   => 'projetosAtividades/projetoAtividade',
                ],
                [
                    'text'  => 'Proponente',
                    'url'   => 'proponentes/proponente',
                ],
                [
                    'text'  => 'Contatos do Proponente',
                    'url'   => 'contatosProponentes/contatoProponente',
                ], 
                [
                    'text'  => 'Setor',
                    'url'   => 'setores/setor',
                ],
                [
                    'text'  => 'Território Turístico',
                    'url'   => 'territoriosTuristicos/territorioTuristico',
                ],
                [
                    'text'  => 'Tipo de Projetos (Eventos)',
                    'url'   => 'tiposProjetos/tipoProjeto',
                ],
                [
                    'text'  => 'UF',
                    'url'   => 'ufs/uf',
                ],
                [
                    'text'  => 'Zona Turística',
                    'url'   => 'zonasTuristicas/zonaTuristica',
                ],


            ],
        ],
        'CONTROLE DE ACESSO',
        [   'text' => 'Controle de Acesso',
            'icon' => 'users',
            'submenu' => [
            [
                'text'       => 'Usuários',
                'url'         => 'usuarios/usuario',
                'icon_color' => 'red',
            ],
            [
                'text'       => 'Perfis',
                'url'         => 'perfis-usuarios/role',
                'icon_color' => 'yellow',
            ],
            [
                'text'       => 'Rotas',
                'url'         => 'rotas/rota',
                'icon_color' => 'aqua',
            ],
            ]],
    ],

    /*
    |--------------------------------------------------------------------------
    | Menu Filters
    |--------------------------------------------------------------------------
    |
    | Choose what filters you want to include for rendering the menu.
    | You can add your own filters to this array after you've created them.
    | You can comment out the GateFilter if you don't want to use Laravel's
    | built in Gate functionality
    |
    */

    'filters' => [
        JeroenNoten\LaravelAdminLte\Menu\Filters\HrefFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\ActiveFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\SubmenuFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\ClassesFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\GateFilter::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Plugins Initialization
    |--------------------------------------------------------------------------
    |
    | Choose which JavaScript plugins should be included. At this moment,
    | only DataTables is supported as a plugin. Set the value to true
    | to include the JavaScript file from a CDN via a script tag.
    |
    */

    'plugins' => [
        'datatables' => true,
        'select2'    => true,
        'chartjs'    => true,
    ],
];
  • I particularly prefer to add these same normal file, type using <script src""></script> and <link href="" rel="stylesheed"> on the page. I use in Laravel and it works perfect

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.