Skip to content

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

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 3 commits into
base: hotfix/hotfix-v30.1.37
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)).FullRowNavigable(true).Render()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ejs-treeview id="treedata" FullRowNavigable="true">
<e-treeview-fields DataSource="ViewBag.dataSource" Id="Id" ParentId="Pid" Text="Name" HasChildren="HasChild" Expanded="Expanded" NavigateUrl="NavigateUrl"></e-treeview-fields>
</ejs-treeview>
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>
83 changes: 83 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,83 @@
---
layout: post
title: Assign URLs to 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-asp-core-mvc
control: ej2-asp-core-mvc
documentation: ug
domainurl: ##DomainURL##
---

# Navigation in ##Platform_Name## TreeView Component

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


Using the [`NavigateUrl`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Navigations.TreeViewFieldsSettings.html#Syncfusion_EJ2_Navigations_TreeViewFieldsSettings_NavigateUrl) of the TreeView component, you can navigate from one page to another based on the node selection and link provided in the corresponding nodes.

To perform navigation in the TreeView component, use and map the `NavigateUrl` field in the data source.

## Navigation URL binding in ##Platform_Name## TreeView Component

In the TreeView component, use the [`NavigateUrl`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Navigations.TreeViewFieldsSettings.html#Syncfusion_EJ2_Navigations_TreeViewFieldsSettings_NavigateUrl) property to specify the URL to navigate to when the tree node is selected.


{% 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" %}

Using the [`NavigateUrl`](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Navigations.TreeViewFieldsSettings.html#Syncfusion_EJ2_Navigations_TreeViewFieldsSettings_NavigateUrl) of the TreeView component, you can navigate from one page to another based on the node selection and link provided in the corresponding nodes.

To perform navigation in the TreeView component, use and map the `NavigateUrl` field in the data source.

## Navigation URL binding in ##Platform_Name## TreeView Component

In the TreeView component, use the [`NavigateUrl`](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Navigations.TreeViewFieldsSettings.html#Syncfusion_EJ2_Navigations_TreeViewFieldsSettings_NavigateUrl) property to specify the URL to navigate to when the tree node is selected.


{% 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 %}


## Full row navigation in ##Platform_Name## TreeView Component

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

The TreeView [`FullRowNavigable`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Navigations.TreeView.html#Syncfusion_EJ2_Navigations_TreeView_FullRowNavigable) property is used to make the entire TreeView node navigable instead of text element in the TreeView component.

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

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

The TreeView [`FullRowNavigable`](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Navigations.TreeView.html#Syncfusion_EJ2_Navigations_TreeView_FullRowNavigable) property is used to make the entire TreeView node navigable instead of text element in the TreeView component.

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/treeview/how-to/fullrownavigate-url-node-cs1/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Nodecheck.cs" %}
{% include code-snippet/treeview/how-to/fullrownavigate-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 @@ -3142,6 +3142,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 @@ -3109,6 +3109,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