Skip to content

Commit

Permalink
Update package 5.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavnavar committed Jan 18, 2024
1 parent d79a37d commit 745d7e5
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 31 deletions.
2 changes: 1 addition & 1 deletion GridBlazor/GridBlazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<LangVersion>11.0</LangVersion>
<GenerateEmbeddedFilesManifest>True</GenerateEmbeddedFilesManifest>
<EnableDefaultEmbeddedResourceItems>False</EnableDefaultEmbeddedResourceItems>
<Version>5.0.6</Version>
<Version>5.0.7</Version>
<Title>GridBlazor</Title>
<Description>Grid components for Blazor</Description>
<Summary>Grid components for Blazor</Summary>
Expand Down
4 changes: 3 additions & 1 deletion GridBlazor/Pages/GridComponent.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,10 @@ public async Task InitExtSorting(IList<ColumnOrderValue> payloads)
foreach (var payload in payloads)
{
Payload = payload;
await AddExtSorting();
Grid.AddQueryString(ColumnOrderValue.DefaultSortingQueryParameter, Payload.ToString());
}
await UpdateGrid();
await OnExtSortChanged();
}

public async Task AddExtSorting()
Expand Down
5 changes: 2 additions & 3 deletions GridBlazorSpring/ColumnCollections/ColumnCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public class ColumnCollections
.RenderValueAs(o => o.Customer.IsVip ? Strings.BoolTrueLabel : Strings.BoolFalseLabel);
};

public static Action<IGridColumnCollection<Order>, Func<object, Task<string>>> OrderColumnsGroupable = (c, customerNameLabel) =>
public static Action<IGridColumnCollection<Order>> OrderColumnsGroupable = c =>
{
/* Adding "OrderID" column: */
c.Add(o => o.OrderID).Titled(SharedResource.Number).SetWidth(100);
Expand All @@ -150,8 +150,7 @@ public class ColumnCollections
c.Add(o => o.Customer.CompanyName).Titled(SharedResource.CompanyName)
.ThenSortBy(o => o.ShipVia)
.ThenSortByDescending(o => o.Freight)
.SetWidth(250)
.SetGroupLabel(customerNameLabel);
.SetWidth(250);
/* Adding "ContactName" column: */
c.Add(o => o.Customer.ContactName).Titled(SharedResource.ContactName);
Expand Down
2 changes: 1 addition & 1 deletion GridBlazorSpring/GridBlazorSpring.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>5.0.5</Version>
<Version>5.0.7</Version>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
</PropertyGroup>

Expand Down
19 changes: 1 addition & 18 deletions GridBlazorSpring/Pages/Groupable.razor
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ else

var query = new QueryDictionary<StringValues>();
string url = "http://localhost:8080/" + "api/SampleData/GetOrdersGridGroupable";
Action<IGridColumnCollection<Order>> columns = c => ColumnCollections.OrderColumnsGroupable(c, SetCustomerNameLabel);
Action<IGridColumnCollection<Order>> columns = ColumnCollections.OrderColumnsGroupable;
var client = new GridClient<Order>(HttpClient, url, query, false, "ordersGrid", columns, locale)
.Sortable()
.Filterable()
Expand All @@ -69,21 +69,4 @@ else
_initGrouping = true;
}
}

protected async Task<string> SetCustomerNameLabel(object value)
{
if (value.GetType() == typeof(string))
{
decimal? max;
decimal? min;
var clientName = (string)value;
var urlParameters = _grid.GetLink().Replace("?", "&");
string url = "http://localhost:8080/" + $"api/SampleData/GetMaxFreight?clientName={clientName}";
max = (await HttpClient.GetFromJsonAsync<Order>(url + urlParameters))?.Freight;
url = "http://localhost:8080/" + $"api/SampleData/GetMinFreight?clientName={clientName}";
min = (await HttpClient.GetFromJsonAsync<Order>(url + urlParameters))?.Freight;
return clientName + "<span class='ml-5'>Max Freight: " + max?.ToString() + "</span><span class='ml-5'>Min Freight: " + min?.ToString() + "</span>";
}
return value.ToString();
}
}
2 changes: 1 addition & 1 deletion GridCore/Filtering/FilterGridItemsProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IQueryable<T> Process(IQueryable<T> items)
if (_process != null)
return _process(items);

if (items == null || items.Count() == 0)
if (items == null)
return items;

var source = items.Expression;
Expand Down
2 changes: 1 addition & 1 deletion GridCore/GridCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<EnableDefaultEmbeddedResourceItems>False</EnableDefaultEmbeddedResourceItems>
<Product>GridCore</Product>
<PackageId>GridCore</PackageId>
<Version>7.0.3</Version>
<Version>7.0.4</Version>
<Title>GridCore</Title>
<Description>Grid core component</Description>
<Summary>Grid core component</Summary>
Expand Down
2 changes: 1 addition & 1 deletion GridCore/Pagination/PagerGridItemsProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public IQueryable<T> Process(IQueryable<T> items)
if (_process != null)
return _process(items);

if (items == null || items.Count() == 0)
if (items == null)
return items;

if (_grid.PagingType == PagingType.Virtualization)
Expand Down
2 changes: 1 addition & 1 deletion GridCore/Searching/SearchGridItemsProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public IQueryable<T> Process(IQueryable<T> items)
if(_process != null)
return _process(items);

if (items == null || items.Count() == 0)
if (items == null)
return items;

if (_grid.SearchOptions.Enabled && !string.IsNullOrWhiteSpace(_settings.SearchValue))
Expand Down
2 changes: 1 addition & 1 deletion GridCore/Sorting/SortGridItemsProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IQueryable<T> Process(IQueryable<T> items)
if (_process != null)
return _process(items);

if (items == null || items.Count() == 0)
if (items == null)
return items;

if (_settings.SortValues?.Count() > 0)
Expand Down
2 changes: 1 addition & 1 deletion GridCore/Totals/TotalsGridItemsProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public IQueryable<T> Process(IQueryable<T> items)
if (_process != null)
return _process(items);

if (items == null || items.Count() == 0)
if (items == null)
return items;

if (_grid.PagingType == PagingType.Virtualization && _grid.Pager.NoTotals)
Expand Down
2 changes: 1 addition & 1 deletion GridMvc/GridMvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<EnableDefaultEmbeddedResourceItems>False</EnableDefaultEmbeddedResourceItems>
<Product>GridMvc</Product>
<PackageId>GridMvcCore</PackageId>
<Version>7.0.3</Version>
<Version>7.0.4</Version>
<Title>GridMvc</Title>
<Description>ASP.NET MVC Grid component</Description>
<Summary>ASP.NET MVC Grid component</Summary>
Expand Down

0 comments on commit 745d7e5

Please sign in to comment.