TargetId

23 Aug 20171 minute to read

This property is used to define the target Id for Navigation Drawer. The drawer opens while you click on the specified target element.

  • CSHTML
  • @{
    
    @Html.EJ().Button("drawerTarget").Text("Open Drawer")
    
    @Html.EJ().NavigationDrawer("navigationPane").Width(300).TargetId("drawerTarget").ContentTemplate(@<div>
    
    @Html.EJ().ListView("list").Width(300).Items(items =>
    
     {
    
    	 items.Add().Text("Home");
    
    	 items.Add().Text("Profile");
    
    	 items.Add().Text("Photos");
    
    	 items.Add().Text("Location");
    
     })
    
    </div>)
    
    }
    
    <style>
    
        #drawerTarget {
    
            top: 200px;
    
            left: 600px;
    
            position: absolute;
    
        }
    
    </style>

    The following screenshots illustrates the output.