New Product LaunchBoldDesk: Help desk ticketing software starts at $10 for 3 agents.
Try it for free.
@using Microsoft.JSInterop
@using Syncfusion.EJ2.Blazor.Grids
<EjsGrid DataSource="@Orders" AllowSorting="true" AllowPaging="true" AllowGrouping="true" Toolbar="@(new List<string>() { "Add","Update", “Delete”})">
...
</EjsGrid>
@code{
[Inject]
IJSRuntime JsRuntime { get; set; }
...
protected override void OnAfterRender(bool firstRender)
{
this.JsRuntime.Ejs().LoadLocaleData("wwwroot/de.json").SetCulture("de");
}
}
|
npm install cldr-data
|
public class CustomAdaptor : DataAdaptor
{
...
public override object Read(DataManagerRequest dm, string key = null) //Handle the sort, filter, search, paging actions here
{
IEnumerable<OrdersDetails> DataSource = order;
if (dm.Search != null && dm.Search.Count > 0)
{
//You can handle your custom Search action codes instead of using PerformSearching
}
if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting
{
//You can handle your custom Sort action codes instead of using PerformSorting
}
if (dm.Where != null && dm.Where.Count > 0) //Filtering
{
//You can handle your custom filter action codes instead of using PerformFiltering
}
int count = DataSource.Cast<OrdersDetails>().Count();
if (dm.Skip != 0)
{
//You can handle your custom skip action codes for paging instead of using PerformSkip
}
if (dm.Take != 0)
{
//You can handle your custom take action codes for paging instead of using PerformTake
}
return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource; //Finally return the result after your custom operations, as like Result and Count pair
}
public override object Insert(DataManager dm, object value, string key)
{
//Handle your custom insert operation and return the value
return value;
}
public override object Remove(DataManager dm, object value, string keyField, string key)
{
//Handle your custom delete operation and return the value
return value;
}
public override object Update(DataManager dm, object value, string keyField, string key)
{
//Handle your custom update operation and return the value
return value;
}
}
|
protected override void OnAfterRender(bool firstRender)
{
string url = "http://cdn.syncfusion.com/content/json/de.json";
string filepath = @"D:ew.json";
using (WebClient json = new MyWebClient())
{
json.DownloadFile(url, filepath);
}
this.JsRuntime.Ejs().LoadLocaleData(filepath).SetCulture("de");
} |