Skip to content

Commit 6ff0c6e

Browse files
committed
Documentation(1023120): Updated sample and ReadME file
1 parent cc25752 commit 6ff0c6e

83 files changed

Lines changed: 573 additions & 1056 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cascading-dropdown-remote-data/filter_core/.vs/config/applicationhost.config

Lines changed: 0 additions & 990 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Cascading-dropdown-remote-data/filter_core/filter_core/Controllers/HomeController.cs renamed to Cascading-dropdown-remote-data/filter_core/Controllers/HomeController.cs

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Microsoft.AspNetCore.Mvc;
77
using filter_core.Models;
88
using Syncfusion.EJ2.Base;
9+
using System.Text.Json;
910

1011
namespace TestSample.Controllers
1112
{
@@ -24,24 +25,49 @@ public IActionResult Index()
2425
}
2526

2627

27-
public IActionResult StateDataSource([FromBody]ExtendedDataManager dm)
28-
{
28+
// public IActionResult StateDataSource([FromBody]ExtendedDataManager dm)
29+
// {
2930

30-
var state = States.getStates();
31+
// var state = States.getStates();
3132

32-
var Data = state.ToList();
33-
int count = state.Count();
33+
// var Data = state.ToList();
34+
// int count = state.Count();
3435

3536

36-
List<States> iterateState= new List<States>();
37-
foreach (States st in state) {
38-
if (st.countryId == (Int64)dm.Where[0].value) {
39-
iterateState.Add(st);
40-
}
41-
}
42-
return dm.RequiresCounts ? Json(new { result = Data.Skip(dm.Skip).Take(dm.Take), count = count }) : Json(iterateState.ToList());
37+
// List<States> iterateState= new List<States>();
38+
// foreach (States st in state) {
39+
// if (st.countryId == (Int64)dm.Where[0].value) {
40+
// iterateState.Add(st);
41+
// }
42+
// }
43+
// return dm.RequiresCounts ? Json(new { result = Data.Skip(dm.Skip).Take(dm.Take), count = count }) : Json(iterateState.ToList());
44+
// }
45+
46+
47+
48+
49+
public IActionResult StateDataSource([FromBody] ExtendedDataManager dm)
50+
{
51+
var states = States.getStates();
52+
53+
int countryId = 0;
54+
55+
if (dm.Where != null && dm.Where.Count > 0)
56+
{
57+
var jsonValue = (JsonElement)dm.Where[0].value;
58+
59+
if (jsonValue.ValueKind == JsonValueKind.Number)
60+
{
61+
countryId = jsonValue.GetInt32(); // or GetInt64()
4362
}
63+
}
64+
65+
var filteredStates = states
66+
.Where(st => st.countryId == countryId)
67+
.ToList();
4468

69+
return Json(filteredStates);
70+
}
4571
public IActionResult CountryDataSource([FromBody]ExtendedDataManager dm)
4672
{
4773

Cascading-dropdown-remote-data/filter_core/filter_core/Models/ErrorViewModel.cs renamed to Cascading-dropdown-remote-data/filter_core/Models/ErrorViewModel.cs

File renamed without changes.

Cascading-dropdown-remote-data/filter_core/filter_core/Program.cs renamed to Cascading-dropdown-remote-data/filter_core/Program.cs

File renamed without changes.

Cascading-dropdown-remote-data/filter_core/filter_core/Properties/launchSettings.json renamed to Cascading-dropdown-remote-data/filter_core/Properties/launchSettings.json

File renamed without changes.

0 commit comments

Comments
 (0)