Autoclose for Navbar?

31 views
Skip to first unread message

Mike Mehli

unread,
Nov 22, 2014, 8:29:37 AM11/22/14
to gwt-bo...@googlegroups.com
Hi Together,

i want to autoclose my NavbarCollapse  after clicking a link.

my Navbar

<b:Panel>
<b:PanelBody>
<b:Navbar addStyleNames="{style.margin-fix}" ui:field="navbar">
<b:NavbarHeader>
<b:NavbarBrand ui:field="navbarbrand"></b:NavbarBrand>
<b:NavbarCollapseButton ui:field="btn"   dataTarget=".navbar-collapse"/>
</b:NavbarHeader>

<b:NavbarCollapse>
<b:NavbarNav>
<b:AnchorListItem icon="PLUS_CIRCLE" ui:field="RoomOverview">Raumbuchung
erstellen</b:AnchorListItem>

<b:AnchorListItem icon="BOOK" ui:field="Raumbuchungen">Meine
Raumbuchungen</b:AnchorListItem>

<b:AnchorListItem icon="CALENDAR" ui:field="Uebersicht">Buchungsübersicht</b:AnchorListItem>


</b:NavbarNav>
<b:NavbarForm pull="RIGHT">

<b:FormGroup>
<b:Heading size="H5" addStyleNames="{style.margin-right}"
ui:field="info" />
</b:FormGroup>

<b:FormGroup>
<b:TextBox addStyleNames="{style.margin-right}"
placeholder="kürz...@hdm-stuttgart.de" ui:field="username" />
</b:FormGroup>

<b:FormGroup>
<b:Input addStyleNames="{style.margin-right}"
placeholder="Passwort" type="PASSWORD" ui:field="password" />
</b:FormGroup>

<b:FormGroup>
<b:Button type="PRIMARY" ui:field="login"
dataLoadingText="Loading..." addStyleNames="{style.margin-right}"></b:Button>
</b:FormGroup>

<b:FormGroup>
<b:Button type="PRIMARY" ui:field="logout"
addStyleNames="{style.margin-right}"></b:Button>
</b:FormGroup>

</b:NavbarForm>
</b:NavbarCollapse>
</b:Navbar>
</b:PanelBody>
</b:Panel>


in my class i do something like this 

@Override
protected void onLoad() {
 super.onLoad();
 bindClick();
}

private native void bindClick() /*-{
 $wnd.jQuery('.nav-collapse').click('li', function() {
   $('.nav-collapse').collapse('hide');
 });
}-*/;

but it dont works! maybe you can help me.
 
Reply all
Reply to author
Forward
0 new messages