Hi,
i'm new to ASP.Net core MVC 6, so my someone can help me.
i would like to use the Navigationdrawer to navigate between pages in one Area.
Currently i've implemented it like this
-->
<div class="container-fluid">
<div class="e-lv">
<div class="e-header">
<div id="butdrawer" class="drawericon e-icon"></div>
<h2>Home</h2>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© 2016 - MWein.Server</p>
</footer>
</div>
<ej-navigation-drawer id="navpane" direction="@NavigationDrawerDirection.Left" type="@NavigationDrawerType.Overlay"
enable-list-view="true" target-id="butdrawer" content-id="container">
<e-list-view-settings width="300" selected-item-index="0" show-header="false" mouse-up="headChange" persist-selection="true" />
<e-content-template>
<ul>
<li data-ej-imageurl="../Images/navigationdrawer/home.png" data-ej-text="Home"
id="navhome"></li>
<li data-ej-imageurl="../Images/navigationdrawer/people.png" data-ej-text="Anwender"
id="navpeople"></li>
<li data-ej-imageurl="../Images/navigationdrawer/profile.png" data-ej-text="Profile"
id="navprofile"></li>
<li data-ej-imageurl="../Images/navigationdrawer/photo.png" data-ej-text="Photos"
id="navphotos"></li>
<li data-ej-imageurl="../Images/navigationdrawer/communities.png" data-ej-text="Communities"
id="navcommunities"></li>
<li data-ej-imageurl="../Images/navigationdrawer/locations.png" data-ej-text="Location"
id="navlocation"></li>
<li data-ej-imageurl="../Images/navigationdrawer/locations.png" data-ej-text="Exit"
id="navexit"></li>
</ul>
</e-content-template>
</ej-navigation-drawer>
</div>
<script type="text/javascript">
function headChange(e) {
$("#butdrawer").parent().children("h2").text(e.text);
var url = '';
switch (e.text) {
case "Home":
url = '@Url.Action("Index", "Administration")';
break;
case "Anwender":
url = '@Url.Action("Index", "AnwenderAdministration")';
break;
case "Exit":
url = '@Url.Action("Index","Home", new { Area = "" })';
break;
}
if (url != ''
&& url != window.location.pathname) {
window.location.rel='nofollow' href = url;
}
$("#navpane").ejNavigationDrawer("close");
}
</script>
<--
So everything works fine.
I can navigate to the new url, but the selected item is lost, so after the new page is loaded, the Home is selected and it navigates to this side.
So my question is, how can i persist the selected item?
Many thanks
Markus