This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking Change: DetailTemplate/EmptyDataTemplate/LoadingDataTemplate no longer need nested Template component Exposed Filtered Items Added Custom Select IFilter Fixed custom IFilters not rendering
- Loading branch information
Showing
28 changed files
with
325 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/BlazorTable.Sample.Shared/Pages/CustomSelectExample.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@page "/CustomSelect" | ||
|
||
@using BlazorTable | ||
|
||
<h1>CustomSelect</h1> | ||
|
||
<p>The <code>CustomSelect</code> can be used to display custom filter options.</p> | ||
<br /> | ||
<Table TableItem="PersonData" Items="data" PageSize="15" ColumnReorder="true"> | ||
<Column TableItem="PersonData" Title="Full Name" Field="@(x => x.full_name)" Sortable="true" Filterable="true" Width="20%"> | ||
<CustomIFilters> | ||
<CustomSelect TableItem="PersonData"> | ||
<CustomSelectOption Key="Astrix Mariette" Value="@("Astrix Mariette")" /> | ||
<CustomSelectOption Key="Marja Mustill" Value="@("Marja Mustill")" /> | ||
<CustomSelectOption Key="Creighton Keyzman" Value="@("Creighton Keyzman")" /> | ||
<CustomSelectOption Key="Jacobo Linton" Value="@("Jacobo Linton")" /> | ||
<CustomSelectOption Key="Michael O'Dyvoy" Value="@("Michael O'Dyvoy")" /> | ||
</CustomSelect> | ||
</CustomIFilters> | ||
</Column> | ||
</Table> | ||
@code | ||
{ | ||
[Inject] | ||
private HttpClient Http { get; set; } | ||
private PersonData[] data; | ||
protected override async Task OnInitializedAsync() | ||
{ | ||
data = await Http.GetJsonAsync<PersonData[]>("sample-data/MOCK_DATA.json"); | ||
} | ||
public class PersonData | ||
{ | ||
public int? id { get; set; } | ||
public string full_name { get; set; } | ||
public string email { get; set; } | ||
public bool? paid { get; set; } | ||
public decimal? price { get; set; } | ||
public CreditCard? cc_type { get; set; } | ||
public DateTime? created_date { get; set; } | ||
} | ||
public enum CreditCard | ||
{ | ||
none = 0, | ||
[Description("MasterCard")] | ||
MasterCard = 1, | ||
Visa = 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* /index.html 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@namespace BlazorTable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace BlazorTable | ||
{ | ||
/// <summary> | ||
/// Option for CustomSelect | ||
/// </summary> | ||
public partial class CustomSelectOption | ||
{ | ||
/// <summary> | ||
/// Parent table | ||
/// </summary> | ||
[CascadingParameter(Name = "CustomSelect")] | ||
public ICustomSelect CustomSelect { get; set; } | ||
|
||
[Parameter] | ||
public string Key { get; set; } | ||
|
||
[Parameter] | ||
public object Value { get; set; } | ||
|
||
/// <summary> | ||
/// When initialized, tell CustomSelect of this item | ||
/// </summary> | ||
protected override void OnInitialized() | ||
{ | ||
CustomSelect.AddSelect(Key, Value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.