diff --git a/README.md b/README.md
index 347f1210..ae86d326 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# BlazorTable
[![Demo](https://img.shields.io/badge/Live-Demo-Blue?style=flat-square)](https://BlazorTable.netlify.com/)
[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/BlazorTable.svg?style=flat-square)](https://www.nuget.org/packages/BlazorTable)
+[![Nuget (with prereleases)](https://img.shields.io/nuget/dt/BlazorTable.svg?style=flat-square)](https://www.nuget.org/packages/BlazorTable)
![](https://github.com/IvanJosipovic/BlazorTable/workflows/CI/CD/badge.svg)
**Work in progress!**
diff --git a/src/BlazorTable.Sample/Pages/EditMode.razor b/src/BlazorTable.Sample/Pages/EditMode.razor
index 3c4d3c53..8e9f7f45 100644
--- a/src/BlazorTable.Sample/Pages/EditMode.razor
+++ b/src/BlazorTable.Sample/Pages/EditMode.razor
@@ -56,7 +56,7 @@
-
+
@(context.created_date.HasValue ? context.created_date.Value.ToShortDateString() : string.Empty)
diff --git a/src/BlazorTable.Sample/Pages/Index.razor b/src/BlazorTable.Sample/Pages/Index.razor
index d558a477..6e767def 100644
--- a/src/BlazorTable.Sample/Pages/Index.razor
+++ b/src/BlazorTable.Sample/Pages/Index.razor
@@ -41,7 +41,7 @@
@(context.fund.HasValue ? context.fund.Value.ToString("C") : string.Empty)
-
+
@(context.created_date.HasValue ? context.created_date.Value.ToShortDateString() : string.Empty)
diff --git a/src/BlazorTable/BlazorTable.csproj b/src/BlazorTable/BlazorTable.csproj
index b08ca3fc..c5a811a4 100644
--- a/src/BlazorTable/BlazorTable.csproj
+++ b/src/BlazorTable/BlazorTable.csproj
@@ -9,7 +9,7 @@
Ivan Josipovic
https://github.com/IvanJosipovic/BlazorTable
Blazor;Table;Grid;DataTable;Data;Sort;Filter;AspNetCore;AspNet
- 0.0.5-alpha
+ 0.0.6-alpha
Experimental
icon.png
diff --git a/src/BlazorTable/Components/Column.razor b/src/BlazorTable/Components/Column.razor
index 64d40abc..ee1fafc3 100644
--- a/src/BlazorTable/Components/Column.razor
+++ b/src/BlazorTable/Components/Column.razor
@@ -10,7 +10,11 @@
- @*@this.CustomIFilters(this)*@
+
+ @*@if (this.CustomIFilters != null)
+ {
+ this.CustomIFilters(this);
+ }*@
diff --git a/src/BlazorTable/Components/Column.razor.cs b/src/BlazorTable/Components/Column.razor.cs
index a9610122..cc175207 100644
--- a/src/BlazorTable/Components/Column.razor.cs
+++ b/src/BlazorTable/Components/Column.razor.cs
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Components;
using System;
-using System.Linq;
using System.Linq.Expressions;
namespace BlazorTable
@@ -50,7 +49,7 @@ public string Title
public Type Type { get; private set; }
- public IFilterManager FilterManager { get; set; }
+ public IFilter FilterControl { get; set; }
public void Dispose()
{
diff --git a/src/BlazorTable/Components/FilterManager.razor b/src/BlazorTable/Components/FilterManager.razor
index ffa83bff..5e161d5b 100644
--- a/src/BlazorTable/Components/FilterManager.razor
+++ b/src/BlazorTable/Components/FilterManager.razor
@@ -1,7 +1,7 @@
@namespace BlazorTable
@typeparam TableItem
-
+
@ChildContent
diff --git a/src/BlazorTable/Components/FilterManager.razor.cs b/src/BlazorTable/Components/FilterManager.razor.cs
index 0f47abec..012b3037 100644
--- a/src/BlazorTable/Components/FilterManager.razor.cs
+++ b/src/BlazorTable/Components/FilterManager.razor.cs
@@ -3,7 +3,7 @@
namespace BlazorTable
{
- public partial class FilterManager : IFilterManager
+ public partial class FilterManager
{
[CascadingParameter(Name = "Column")] public IColumn Column { get; set; }
@@ -11,21 +11,21 @@ public partial class FilterManager : IFilterManager
[Inject] public ILogger> Logger { get; set; }
- public IFilter Filter { get; set; }
-
protected override void OnInitialized()
{
- Column.FilterManager = this;
}
private void ApplyFilter()
{
Column.ToggleFilter();
- if (Filter != null)
+ if (Column.FilterControl != null)
{
- Filter.ApplyFilter();
+ Column.Filter = Column.FilterControl.GetFilter();
Column.Table.Update();
Column.Table.FirstPage();
+ } else
+ {
+ Logger.LogInformation("Filter is null");
}
}
diff --git a/src/BlazorTable/Filters/BooleanFilter.razor b/src/BlazorTable/Filters/BooleanFilter.razor
index 96bd214d..d9ef07ae 100644
--- a/src/BlazorTable/Filters/BooleanFilter.razor
+++ b/src/BlazorTable/Filters/BooleanFilter.razor
@@ -1,7 +1,7 @@
@namespace BlazorTable
@typeparam TableItem
-@if (FilterTypes.Contains(FilterManager.Column.Type.GetNonNullableType()))
+@if (FilterTypes.Contains(Column.Type.GetNonNullableType()))
{