Skip to content

911643: Added UG documentation for node navigation in Treeview component #4221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: hotfix/hotfix-v29.2.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
public IActionResult CheckBox()
{
List<object> treedata = new List<object>();
treedata.Add(new
{
Id = 1,
Name = "Vue",
HasChild = true,
Expanded = true,
NavigateUrl: 'https://ej2.syncfusion.com/vue/documentation/treeview/getting-started'
});
treedata.Add(new
{
Id = 2,
Pid = 1,
Name = "JavaScript",
NavigateUrl: 'https://ej2.syncfusion.com/javascript/documentation/treeview/es5-getting-started'

});
treedata.Add(new
{
Id = 3,
Pid = 1,
Name = "ASP.NET Core",
NavigateUrl: 'https://ej2.syncfusion.com/aspnetcore/documentation/treeview/getting-started',
});

treedata.Add(new
{
Id = 4,
Name: 'Angular',
HasChild: true,
NavigateUrl: 'https://ej2.syncfusion.com/angular/documentation/treeview/getting-started',
});
treedata.Add(new
{
Id: 5,
Pid: 4,
Name: 'Blazor',
NavigateUrl: 'https://blazor.syncfusion.com/documentation/treeview/getting-started-webapp',

});
treedata.Add(new
{
Id: 6,
Pid: 4,
Name: 'React',
NavigateUrl:'https://ej2.syncfusion.com/react/documentation/treeview/getting-started',
});
ViewBag.dataSource = treedata;
return View();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Syncfusion.EJ2.Navigations;

public ActionResult CheckBox()
{
List<object> treedata = new List<object>();
treedata.Add(new
{
Id = 1,
Name = "Vue",
HasChild = true,
Expanded = true,
NavigateUrl: 'https://ej2.syncfusion.com/vue/documentation/treeview/getting-started'
});
treedata.Add(new
{
Id = 2,
Pid = 1,
Name = "JavaScript",
NavigateUrl: 'https://ej2.syncfusion.com/javascript/documentation/treeview/es5-getting-started'

});
treedata.Add(new
{
Id = 3,
Pid = 1,
Name = "ASP.NET Core",
NavigateUrl: 'https://ej2.syncfusion.com/aspnetcore/documentation/treeview/getting-started',
});

treedata.Add(new
{
Id = 4,
Name: 'Angular',
HasChild: true,
NavigateUrl: 'https://ej2.syncfusion.com/angular/documentation/treeview/getting-started',
});
treedata.Add(new
{
Id: 5,
Pid: 4,
Name: 'Blazor',
NavigateUrl: 'https://blazor.syncfusion.com/documentation/treeview/getting-started-webapp',

});
treedata.Add(new
{
Id: 6,
Pid: 4,
Name: 'React',
NavigateUrl:'https://ej2.syncfusion.com/react/documentation/treeview/getting-started',
});
ViewBag.dataSource = treedata;
return View();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@Html.EJS().TreeView("treedata").Fields(field=>
field.Id("Id").ParentID("Pid").Text("Name").HasChildren("HasChild").Expanded("Expanded").NavigateUrl("NavigateUrl")
.DataSource(ViewBag.dataSource)).Render()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ejs-treeview id="treedata">
<e-treeview-fields DataSource="ViewBag.dataSource" Id="Id" ParentId="Pid" Text="Name" HasChildren="HasChild" Expanded="Expanded" NavigateUrl="NavigateUrl"></e-treeview-fields>
</ejs-treeview>
38 changes: 38 additions & 0 deletions ej2-asp-core-mvc/treeview/how-to/assign-url-to-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: post
title: How to Assign URLs to TreeView Nodes in ##Platform_Name## TreeView component | Syncfusion
description: Learn here all about Assign URLs to specific nodes in Syncfusion ##Platform_Name## TreeView component of Syncfusion Essential JS 2 and more.
platform: ej2-vue
control: ej2-asp-core-mvc
documentation: ug
domainurl: ##DomainURL##
---

# How to Assign URLs to TreeView Nodes in TreeView component

{% if page.publishingplatform == "aspnet-core" %}

You can able to assign url to the nodes of TreeView by using [NavigateUrl](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Navigations.TreeViewFieldsSettings.html#Syncfusion_EJ2_Navigations_TreeViewFieldsSettings_NavigateUrl) in field property.

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/treeview/how-to/navigate-url-node-cs1/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Nodecheck.cs" %}
{% include code-snippet/treeview/how-to/navigate-url-node-cs1/node-url-core.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

You can able to assign url to the nodes of TreeView by using [NavigateUrl](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Navigations.TreeViewFieldsSettings.html#Syncfusion_EJ2_Navigations_TreeViewFieldsSettings_NavigateUrl) in field property.

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/treeview/how-to/navigate-url-node-cs1/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Nodecheck.cs" %}
{% include code-snippet/treeview/how-to/navigate-url-node-cs1/node-url-mvc.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}
1 change: 1 addition & 0 deletions ej2-asp-core-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@
<li><a href="/ej2-asp-core/treeview/how-to/customize-the-tree-nodes-based-on-levels">Customize The Tree Nodes Based On Levels</a></li>
<li><a href="/ej2-asp-core/treeview/how-to/restrict-the-drag-and-drop-for-particular-tree-nodes">Restrict The Drag-and-Drop For Particular Tree Nodes</a></li>
<li><a href="/ej2-asp-core/treeview/how-to/manipulating-nodes">Nodes manipulation</a></li>
<li><a href="/ej2-asp-core/treeview/how-to/assign-url-to-node">Assign navigate URL to nodes</a></li>
</ul>
</li>
<li><a href="/ej2-asp-core/treeview/ej1-api-migration">Migration From Essential JS 1</a></li>
Expand Down
1 change: 1 addition & 0 deletions ej2-asp-mvc-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3078,6 +3078,7 @@
<li><a href="/ej2-asp-mvc/treeview/how-to/customize-the-tree-nodes-based-on-levels">Customize The Tree Nodes Based On Levels</a></li>
<li><a href="/ej2-asp-mvc/treeview/how-to/restrict-the-drag-and-drop-for-particular-tree-nodes">Restrict The Drag-and-Drop For Particular Tree Nodes</a></li>
<li><a href="/ej2-asp-mvc/treeview/how-to/manipulating-nodes">Nodes manipulation</a></li>
<li><a href="/ej2-asp-mvc/treeview/how-to/assign-url-to-node">Assign navigate URL to nodes</a></li>
</ul>
</li>
<li><a href="/ej2-asp-mvc/treeview/ej1-api-migration">Migration From Essential JS 1</a></li>
Expand Down