Skip to content

938381: Test and resolve issues in UG all sections - ASP MVC Dropdown Tree control. #3866

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

Merged
merged 2 commits into from
Feb 7, 2025
Merged
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
@@ -1,9 +1,3 @@
<div id='container' style="margin:0 auto; width:250px;">
@Html.EJS().DropDownTree("tree").Fields(field =>
field.Query("new ej.data.Query().from('Employees').select('EmployeeID,FirstName,Title').take(5)").Value("EmployeeID").ParentValue("pid").Selected("selected")
.Text("FirstName").HasChildren("EmployeeID")
.DataSource(dataSource =>
{
dataSource.Url("https://services.odata.org/V4/Northwind/Northwind.svc").Adaptor("ODataV4Adaptor").CrossDomain(true);
}).Child(ViewBag.child)).Render()
@Html.EJS().DropDownTree("ddtremote").Placeholder("Select a name").Fields(ViewBag.remoteFields).Render()
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,30 @@ namespace DropDownTree.Controllers
{
public class DropDownListController : Controller
{
public IActionResult RemoteData()
public ActionResult RemoteData()
{
DropDownTreeFields parentData = new DropDownTreeFields();
DropDownTreeFields childData = new DropDownTreeFields();
childData.Query = "new ej.data.Query().from('Orders').select('OrderID,EmployeeID,ShipName').take(5)";
childData.Value = "OrderID";
childData.Text = "ShipName";
childData.ParentValue = "EmployeeID";
childData.DataSource = new Syncfusion.EJ2.DataManager
object data = new DataManager
{
Url = "https://services.odata.org/V4/Northwind/Northwind.svc",
Adaptor = "ODataV4Adaptor",
CrossDomain = true
};
ViewBag.child = childData;
// Parent data mapping
parentData.Query = "new ej.data.Query().from('Employees').select('EmployeeID,FirstName,Title').take(5)";
parentData.Value = "EmployeeID";
parentData.Text = "FirstName";
parentData.HasChildren = "EmployeeID";
parentData.Child = childData;
parentData.DataSource = data;
// Child data mapping
childData.Query = "new ej.data.Query().from('Orders').select('OrderID,EmployeeID,ShipName').take(5)";
childData.Value = "OrderID";
childData.Text = "ShipName";
childData.ParentValue = "EmployeeID";
childData.DataSource = data;
ViewBag.remoteFields = parentData;
return View();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="control-section">
<div style="margin: 0 auto; width:350px;">
@Html.EJS().DropDownTree("ddtremote").Placeholder("Select a name").PopupHeight("200px").ActionFailureTemplate("<span class='action-failure'> Data fetch request fails</span>").Fields(ViewBag.remoteFields).Render()
@Html.EJS().DropDownTree("ddtremote").Placeholder("Select a name").Width("300px").PopupHeight("200px").ActionFailureTemplate("<span class='action-failure'> Data fetch request fails</span>").Fields(ViewBag.remoteFields).Render()
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using Syncfusion.EJ2.DropDowns
<div class="control-section">
<div style="margin: 0 auto; width:350px;">
@Html.EJS().DropDownTree("ddt").Placeholder("Select an employee").Mode(Mode.Custom).CustomTemplate("${value.length} item(s) selected").ShowCheckBox(true).PopupHeight("200px").Fields(ViewBag.templateData).Render()
@Html.EJS().DropDownTree("ddt").Width("300px").Placeholder("Select an employee").Mode(Mode.Custom).CustomTemplate("${value.length} item(s) selected").ShowCheckBox(true).PopupHeight("200px").Fields(ViewBag.templateData).Render()
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="control-section">
<div style="margin: 0 auto; width:350px;">
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("350px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div class=\"ename\">${name}</div>").FooterTemplate("<div class=\"footer\"><div class=\"footer-content\">Total number of employees: 10 </div></div>").Render()
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("300px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div class=\"ename\">${name}</div>").FooterTemplate("<div class=\"footer\"><div class=\"footer-content\">Total number of employees: 10 </div></div>").Render()
</div>
</div>
<style>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="control-section">
<div style="margin: 0 auto; width:350px;">
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("350px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div class=\"ename\">${name}</div>").HeaderTemplate("<div class=\"head\">Employee List</div>").Render()
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("300px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div class=\"ename\">${name}</div>").HeaderTemplate("<div class=\"head\">Employee List</div>").Render()
</div>
</div>
<style>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="control-section">
<div style="margin: 0 auto; width:350px;">
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("350px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div><span class=\"ename\">${name} - </span><span class=\"ejob\">${job}</span></div>").Render()
<div style="margin: 0 auto; width:250px;">
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("300px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div><span class=\"ename\">${name} - </span><span class=\"ejob\">${job}</span></div>").Render()
</div>
</div>
<style>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="control-section">
<div style="margin: 0 auto; width:350px;">
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("350px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div><span class=\"ename\">${name} - </span><span class=\"ejob\">${job}</span></div>").ValueTemplate("<div><span class=\"ename\">${name} - </span><span class=\"ejob\">${job}</span></div>").Render()
@Html.EJS().DropDownTree("ddt").CssClass("custom").Placeholder("Select an employee").Width("300px").PopupHeight("250px").Fields(ViewBag.templateData).ItemTemplate("<div><span class=\"ename\">${name} - </span><span class=\"ejob\">${job}</span></div>").ValueTemplate("<div><span class=\"ename\">${name} - </span><span class=\"ejob\">${job}</span></div>").Render()
</div>
</div>
<style>
Expand Down