Search results

Dock

Dock state of the Sidebar reserves some space on the page that always remains in a visible state when the Sidebar is collapsed. It is used to show the short term of a content like icons alone instead of lengthy text.

razor
dock.cs
@{Html.EJS().Sidebar("dockSidebar").Width("220px").DockSize("72px").EnableDock(true).ContentTemplate(@<div>
        <div class="dock">
            <ul>
                <li class="sidebar-item" id="toggle">
                    <span class="e-icons expand"></span>
                    <span class="e-text" title="menu">Menu</span>
                </li>
                <li class="sidebar-item">
                    <span class="e-icons home"></span>
                    <span class="e-text" title="home">Home</span>
                </li>
                <li class="sidebar-item">
                    <span class="e-icons profile"></span>
                    <span class="e-text" title="profile">Profile</span>
                </li>
                <li class="sidebar-item">
                    <span class="e-icons info"></span>
                    <span class="e-text" title="info">Info</span>
                </li>
                <li class="sidebar-item">
                    <span class="e-icons settings"></span>
                    <span class="e-text" title="settings">Settings</span>
                </li>
            </ul>
        </div>
    </div>).Render();}

<!-- end of sidebar element -->
<!-- main content declaration -->
<div id="main-content container-fluid col-md-12 ">
    <div class="title">Main content</div>
    <div class="sub-title"> Click the expand icon to open and collapse icons to close the Sidebar.</div>
</div>
<script>
    document.addEventListener('DOMContentLoaded', function () {
        dockBar = document.getElementById("dockSidebar").ej2_instances[0];
        document.getElementById("toggle").addEventListener('click', function () {
            dockBar.toggle();
        });
    });
    function positionChange(args) {
        dockBar.position = args.event.target.id == "Left" ? "Left" : "Right";
    }

</script>




<style>
    .title {
        text-align: center;
        font-size: 20px;
        padding: 15px;
    }

    .sub-title {
        text-align: center;
        font-size: 16px;
        padding: 10px;
    }

    #wrapper .column {
        display: inline-block;
        padding: 10px;
    }

    .center {
        text-align: center;
        display: none;
        font-size: 13px;
        font-weight: 400;
        margin-top: 20px;
    }

    .sb-content-tab .center {
        display: block;
    }
    /* end of content area styles */
    /* Sidebar styles */

    .sb-content-tab #wrapper {
        display: none;
    }

    #dockSidebar.e-sidebar.e-right.e-close {
        visibility: visible;
        transform: translateX(0%);
    }

    #dockSidebar .e-icons::before {
        font-size: 25px;
    }
    /* dockbar icon Style */

    #dockSidebar .home::before {
        content: '\e7a4';
    }

    #dockSidebar .profile::before {
        content: '\e7d4';
    }

    #dockSidebar .info::before {
        content: '\e7e7';
    }

    #dockSidebar .settings::before {
        content: '\e7cf';
    }

    #dockSidebar.e-sidebar .expand::before,
    #dockSidebar.e-sidebar.e-right.e-open .expand::before {
        content: '\e85c';
    }

    #dockSidebar.e-sidebar.e-open .expand::before,
    #dockSidebar.e-sidebar.e-right .expand::before {
        content: '\e98f';
    }
    /* end of dockbar icon Style */

    #dockSidebar.e-close .sidebar-item {
        padding: 5px 20px;
    }

    #dockSidebar.e-dock.e-close span.e-text {
        display: none;
    }

    #dockSidebar.e-dock.e-open span.e-text {
        display: inline-block;
    }

    #dockSidebar li {
        list-style-type: none;
        cursor: pointer;
    }

    #dockSidebar ul {
        padding: 0px;
    }

    #dockSidebar.e-sidebar ul li:hover span {
        color: white
    }

    #dockSidebar.e-sidebar.e-open .e-text {
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 23px;
        font-size: 15px;
    }

    #dockSidebar.e-sidebar.e-open .e-icons {
        margin-right: 16px;
    }

    #dockSidebar.e-sidebar span.e-icons {
        color: #c0c2c5;
        line-height: 2
    }

    #dockSidebar.e-sidebar .e-open .e-icons {
        margin-right: 16px;
    }

    #dockSidebar.e-sidebar .e-open .e-text {
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 23px;
        font-size: 15px;
    }

    .sidebar-item {
        text-align: center;
        border-bottom: 1px #e5e5e58a solid;
    }

    #dockSidebar.e-sidebar.e-open .sidebar-item {
        text-align: left;
        padding-left: 15px;
        color: #c0c2c5;
    }

    #dockSidebar.e-sidebar {
        background: #2d323e;
        overflow: hidden;
    }
    /* end of sidebar styles */
</style>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers
{
    public partial class SidebarController : Controller
    {
        public IActionResult dock()
        {
            return View();
        }
    }
}