I managed to get the Responsive Sidebar with TreeView to work as per the below thread...
https://www.syncfusion.com/forums/162795/responsive-panel
However, I am not sure how I can load a page in the "main-content" following selection of a TreeView item. The example project above has hardcoded text in the "main-content" div with now code showing how to replace this following a selection.
To put it another way, I am trying to mimic the NavLink functionality where selection loads a given page...
<NavLink class="nav-link" rel='nofollow' href="pageToLoad">
I also found the below demo which also does not list how to wire up page loading...
Help much appreciated!
Thanks.
|
<SfSidebar ID="sidebar" HtmlAttributes="@HtmlAttribute" Target=".main-content" Width="220px" MediaQuery="(min-width:600px)" @ref="Sidebar">
<ChildContent>
</ChildContent>
</SfSidebar>
<div class="main-content" id="maintext">
<div class="content">
@Body
</div>
</div> |
|
<SfTreeView CssClass="main-treeview" @ref="TreeView" ExpandOn="@Expand" TValue="TreeData">
<TreeViewFieldsSettings Id="nodeId" Text="nodeText" DataSource="treedata" HasChildren="hasChild" IconCss="iconCss" NavigateUrl="navigateUrl" ParentID="pid">
</TreeViewFieldsSettings>
</SfTreeView> protected override void OnInitialized() {
base.OnInitialized();
treedata.Add(new TreeData { nodeId = "01", nodeText = "Installation", navigateUrl ="/"});
treedata.Add(new TreeData { nodeId = "02", nodeText = "Deployment", navigateUrl="/Counter" });
treedata.Add(new TreeData { nodeId = "03", nodeText = "Quick Start", navigateUrl="/FetchData"});
treedata.Add(new TreeData { nodeId = "04", nodeText = "Components", hasChild=true, iconCss = "e-icons e-font", navigateUrl ="/Error" });
} |
Many thanks Indhumathy, this worked just as I needed!
I'm just getting into Blazor and really appreciate the inclusion of sample projects with mine and others questions. It's very helpful.
Thanks,
Ross