kartik-v / yii2-nav-x

Extended bootstrap Nav widget with submenu option for Yii 2.
http://plugins.krajee.com/nav-x
Other
28 stars 3 forks source link

Can not click url for levels #4

Closed levanlau closed 10 years ago

levanlau commented 10 years ago

Hi, I have used yii2-nav-x very good,but i have faced an issue following: I have 3 menu levels :Level1->Level2->Level3,all has url but i only click url of last level,but another levels not.

$menuList=[
['label'=>'Level1','url'=>$url1,
'items'=>['label'=>'Level2','url'=>$url2,
'items'=>['label'=>Level3,'url'=>$url3]
]
],
];
echo NavX::widget([
        'encodeLabels' => false,
        'options'=>['class'=>'nav nav-pills nav-stacked me-dropdown-menu'],
        'items' => $menuList
    ]);

I can only click url with $url3.How can i click $url2,$url1? Thanks.

kartik-v commented 10 years ago

You can either have a submenu or a clickable url for menu item. You cannot have both submenu and url attached to a single item.

Note: A submenu opens up its submenu items only on click... so how do you think it will achieve both. If it is set to open up the url, it will navigate you out of the page and not show the submenu at all. Hence a submenu has been setup to not redirect to any url.

levanlau commented 10 years ago

Thank you for your quick reply. I see what you had said.I though i should add a Html::a(...) for this.Thanks.