i use bootstrap 3 and i try to display a button group with a submenu.
i use bootstrap-submenu
i created the menu
http://jsfiddle.net/L8kbaqw3/
<div class="btn-group">
<button class="btn btn-primary" type="button">Actions</button>
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" data-submenu="" aria-expanded="false">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a tabindex="0">Annuler</a></li>
<li><a tabindex="0">Sauvegarder</a></li>
<li class="divider"></li>
<li class="dropdown-submenu">
<a tabindex="0">Payer</a>
<ul class="dropdown-menu">
<li><a tabindex="0">Comptant</a></li>
<li><a tabindex="0">Débit</a></li>
<li><a tabindex="0">Carte de crédit</a></li>
<li><a tabindex="0">Carte cadeaux</a></li>
<li><a tabindex="0">Chèque</a></li>
</ul>
</li>
</ul>
</div>
</div>
that work fine.
but when i try to add something under it, i don't see all the menu
http://jsfiddle.net/hxnznnz6/
it's seem like something block it to display completly the menu.
Also if you compare the layout of the two button, it's different
Edit
i removed the first btn-group like #Eduardo Arruda Pimentel said.
look ok, but the sub menu of Payer is not displayed when i click on it
New result
http://jsfiddle.net/wn9u5z28/
1)Bootstrap 3 removed support for multilevel dropdowns, citing usability issues as the cause. As you can see in these two links:
Bootstrap 3 dropdown sub menu missing
Responsive multilevel menu with Bootstrap 3
2) The reason for the different layout is that the code is different. To solve that, just recode and delete this part of line 3:
class="btn-group"
Related
I am using Bootstrap dropdown menu with angular. I want to make some menu items visible and invisible using the display property. Class hidden_item is defined as display:none. When the user logs in, it does show the "Messages" menu item but clicking on it does not show Inbox and Sent links. Later if I refresh the page, everything works as expected and Inbox and Sent become visible. How can I make it work without refreshing the page?
<li [ngClass]="isLoggedIn() ? 'dropdown' : 'hidden_item'">
<a [routerLink]="['Mailbox', {'boxname': 'inbox'}]" class="dropdown-toggle">Messages <span class="nav-up-carret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a [routerLink]="['Mailbox', {'boxname': 'inbox'}]">Inbox</a> </li>
<li><a [routerLink]="['Mailbox', {'boxname': 'sent'}]">Sent</a></li>
</ul>
</li>
You can use *ngIf and try it this way:
li *ngIf="isLogedIn()">
<a [routerLink]="['Mailbox', {'boxname': 'inbox'}]" class="dropdown-toggle">Messages <span class="nav-up-carret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a [routerLink]="['Mailbox', {'boxname': 'inbox'}]">Inbox</a> </li>
<li><a [routerLink]="['Mailbox', {'boxname': 'sent'}]">Sent</a></li>
</ul>
</li>
This way, angular will automatically remove the block from the dom if isLogedIn() returns false but will add it if it returns true.
If I understood your problem correctly, you are missing a data-toggle="dropdown" property in your 'Messages' anchor element.
It should be
<li [ngClass]="isLogedIn() ? 'dropdown' : 'hidden_item'">
<a [routerLink]="['Mailbox', {'boxname': 'inbox'}]" class="dropdown-toggle" data-toggle="dropdown">Messages <span class="nav-up-carret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a [routerLink]="['Mailbox', {'boxname': 'inbox'}]">Inbox</a> </li>
<li><a [routerLink]="['Mailbox', {'boxname': 'sent'}]">Sent</a></li>
</ul>
</li>
I use materializecss and want to implement dropdown in floating button with icon inside.
Here is the markup:
<a href="#" class="dropdown-button btn-floating btn-sm waves-effect waves-light" :data-activates="'dropdown_' + order.id">
<i class="small material-icons">more_horiz</i>
</a>
<ul :id="'dropdown_' + order.id" class="dropdown-content">
<li>one</li>
<li>two</li>
<li class="divider"></li>
<li>three</li>
<li><i class="material-icons">view_module</i>four</li>
<li><i class="material-icons">cloud</i>five</li>
</ul>
Which is basically the same as in docs, however instead of simple button I use floating button and an icon inside. Without <i> it works fine, however with <i> I got display: none; for the dropdown.
How can I fix this?
update
Worked for me after updating to 0.98.2
When I clicked on sub menu item my menu get closed, if I clinked on sub menu items. Please let me know how can I avoid this.
Actually "open" class get remove on clicking sub item.
<ul class='wraplist' style="height: auto">
<li class="">
<a href="javascript:;">
<i class="fa fa-home"></i>
<span class="title">{{app.translateByLocale('menu_home')}}/span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li submenu ng-show="app.checkOffSectionConfig('app_home')">
{{app.translateByLocale('menu_home_dashboard')}}
</li>
<li submenu ng-show="app.checkOffSectionConfig('app_statistic')">
{{app.translateByLocale('menu_home_statistics')}}
</li>
</ul>
</li>
</ul>
You can use e.preventDefault() to overwrite the default behavior by binding it with the click event on the sub menu item.
I am currently using the CSS bootstrap 3.2 in my application.
I am trying to place 2 drop down menu "with the arrow only- not button style" next to each other and then to the right I want to add a search bar.
I want to use the the dropdown menu that the bootstrap has but without the button style "arrow only" and a small search bar to the right in the vertical center.
I have tried to do that but the dropdown menus and the search bar do not line up.
here is a screenshot of what I have done
and here is my code
<ul class="nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle menu-sm-padding" data-toggle="dropdown" href="#">
My Name <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>My Profile</li>
<li role="presentation" class="divider"></li>
<li>Logout</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle menu-sm-padding" data-toggle="dropdown" href="#">
My Company Name <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu"><li><a class="master_client_change" href="#" id="current_client_id_2">Comp 1</a></li><li><a class="master_client_change" href="#" id="current_client_id_1">Comp 2</a></li><li><a class="master_client_change" href="#" id="current_client_id_3">Comp 3</a></li><li><a class="master_client_change" href="#" id="current_client_id_6">Comp 4</a></li></ul>
</li>
</ul>
<div class="width-sm-size box-inline-block">
<form action="/accounts_search.php" method="get" id="searchforactivities" class="navbar-form navbar-right row-right-xxsm-margin" role="search">
<div class="input-group">
<input type="search" class="form-control" name="search_term">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Go</button>
</span>
</div>
</form>
</div>
How can I get the dropdown menu and the search bar to line up?
and is there a trick in making the search bar little fancy by making the the corners of the input round and the Go button a search icon?
Upon clicking the 'Gmail' (with arrow next to it), menu options such as 'Contacts', 'Tasks' show up.
Is there a similar component in bootstrap? or any other plugin to achieve the same?
Are you thinking of something like this? http://cdpn.io/BqHfm
It's based on the Bootstrap Dropdown
<div class="dropdown">
<a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="/page.html">
Mail <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li>Mail</li>
<li>Contacts</li>
<li>Tasks</li>
</ul>
</div>
Good luck!