Skip to content

Commit 6b3b08e

Browse files
Merge pull request SyncfusionExamples#2 from Backiaraj/UG
Prepared AutoComplete and Avatar samples
2 parents b6617b6 + 0247bc8 commit 6b3b08e

File tree

360 files changed

+298835
-0
lines changed

Some content is hidden

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

360 files changed

+298835
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="20.1.0.58" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32112.339
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoCompleteCustomSample", "AutoCompleteCustomSample.csproj", "{F5ED729A-BB41-439B-B0B2-5CD6907B9533}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{F5ED729A-BB41-439B-B0B2-5CD6907B9533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{F5ED729A-BB41-439B-B0B2-5CD6907B9533}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{F5ED729A-BB41-439B-B0B2-5CD6907B9533}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{F5ED729A-BB41-439B-B0B2-5CD6907B9533}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {A5A8730E-43D3-4ECA-91AA-BBD9449DF2F9}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace AutoCompleteCustomSample.Models
7+
{
8+
public class Countries
9+
{
10+
public string Name { get; set; }
11+
public string Code { get; set; }
12+
public List<Countries> CountriesList()
13+
{
14+
List<Countries> country = new List<Countries>();
15+
country.Add(new Countries { Name = "Australia", Code = "AU" });
16+
country.Add(new Countries { Name = "Bermuda", Code = "BM" });
17+
country.Add(new Countries { Name = "Canada", Code = "CA" });
18+
country.Add(new Countries { Name = "Cameroon", Code = "CM" });
19+
country.Add(new Countries { Name = "Denmark", Code = "DK" });
20+
country.Add(new Countries { Name = "France", Code = "FR" });
21+
country.Add(new Countries { Name = "Finland", Code = "FI" });
22+
country.Add(new Countries { Name = "Germany", Code = "DE" });
23+
country.Add(new Countries { Name = "Greenland", Code = "GL" });
24+
country.Add(new Countries { Name = "Hong Kong", Code = "HK" });
25+
country.Add(new Countries { Name = "India", Code = "IN" });
26+
country.Add(new Countries { Name = "Italy", Code = "IT" });
27+
country.Add(new Countries { Name = "Japan", Code = "JP" });
28+
country.Add(new Countries { Name = "Mexico", Code = "MX" });
29+
country.Add(new Countries { Name = "Norway", Code = "NO" });
30+
country.Add(new Countries { Name = "Poland", Code = "PL" });
31+
country.Add(new Countries { Name = "Switzerland", Code = "CH" });
32+
country.Add(new Countries { Name = "United Kingdom", Code = "GB" });
33+
country.Add(new Countries { Name = "United States", Code = "US" });
34+
return country;
35+
}
36+
}
37+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@page
2+
@using AutoCompleteCustomSample.Models;
3+
@model AutoCompleteCustomSample.Pages.CustomSearchModel
4+
@{
5+
var data = new Countries().CountriesList();
6+
}
7+
<div id='iconList' class='col-lg-6' style='padding-top:15px'>
8+
<div class='content'>
9+
<ejs-autocomplete id="country" dataSource="@data" highlight="true" placeholder="Select a social media">
10+
<e-autocomplete-fields value="Name"></e-autocomplete-fields>
11+
</ejs-autocomplete>
12+
</div>
13+
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace AutoCompleteCustomSample.Pages
5+
{
6+
public class CustomSearchModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
}
12+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
using System.Diagnostics;
4+
5+
namespace AutoCompleteCustomSample.Pages
6+
{
7+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8+
[IgnoreAntiforgeryToken]
9+
public class ErrorModel : PageModel
10+
{
11+
public string? RequestId { get; set; }
12+
13+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14+
15+
private readonly ILogger<ErrorModel> _logger;
16+
17+
public ErrorModel(ILogger<ErrorModel> logger)
18+
{
19+
_logger = logger;
20+
}
21+
22+
public void OnGet()
23+
{
24+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25+
}
26+
}
27+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@page
2+
@using Newtonsoft.Json;
3+
@using AutoCompleteCustomSample.Models;
4+
@model AutoCompleteCustomSample.Pages.FilterwithTextandValueFieldModel
5+
@{
6+
var data = new Countries().CountriesList();
7+
}
8+
<div id='List' class='col-lg-6' style='padding-top:15px'>
9+
<div class='content'>
10+
<ejs-autocomplete dataSource="@data" showClearButton="false" id="project" filtering="filtering" itemTemplate="<span class='item'><span class='name'>${Name}</span>-<span class='code'>${Code}</span></span>">
11+
<e-autocomplete-fields Text ="Name" Value ="Code"></e-autocomplete-fields>
12+
</ejs-autocomplete>
13+
</div>
14+
</div>
15+
<script>
16+
function filtering(e) {
17+
var predicate = new ej.data.Predicate('Name', 'contains', e.text, true);
18+
predicate = predicate.or('Code', 'contains', e.text);
19+
var query = new ej.data.Query();
20+
query = (e.text !== '' && e.value !== '') ? query.where(predicate) : query;
21+
e.updateData(@Html.Raw(JsonConvert.SerializeObject(ViewBag.data)), query);
22+
}
23+
</script>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace AutoCompleteCustomSample.Pages
5+
{
6+
public class FilterwithTextandValueFieldModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
}
12+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@page
2+
@using AutoCompleteCustomSample.Models;
3+
@model IndexModel
4+
@{
5+
ViewData["Title"] = "Home page";
6+
var data = new Countries().CountriesList();
7+
}
8+
9+
<div class="control-wrapper">
10+
<div id="default" style='padding-top:75px;margin:0 auto;width:250px;'>
11+
<ejs-autocomplete id="country" datasource="@data" placeholder="e.g. India" autofill="true" popupheight="220px">
12+
<e-autocomplete-fields value="Name"></e-autocomplete-fields>
13+
</ejs-autocomplete>
14+
</div>
15+
</div>

0 commit comments

Comments
 (0)