diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 00000000..7c1f20b3
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,52 @@
+# ASP.NET
+# Build and test ASP.NET projects.
+# Add steps that publish symbols, save build artifacts, deploy, and more:
+# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
+
+pool:
+ vmImage: 'windows-latest'
+
+variables:
+ solution: '**/*.sln'
+ buildPlatform: 'Any CPU'
+ buildConfiguration: 'Release'
+ Parameters.requestedMajorVersion: '1'
+ Parameters.requestedMinorVersion: '17'
+ Parameters.requestedPatchVersion: '3'
+steps:
+
+- task: NuGetToolInstaller@1
+
+- task: DotNetCoreCLI@2
+ inputs:
+ command: 'restore'
+ feedsToUse: 'select'
+
+- task: VSBuild@1
+ inputs:
+ solution: '$(solution)'
+ platform: '$(buildPlatform)'
+ configuration: '$(buildConfiguration)'
+
+- task: VSTest@2
+ inputs:
+ platform: '$(buildPlatform)'
+ configuration: '$(buildConfiguration)'
+
+- task: DotNetCoreCLI@2
+ inputs:
+ command: 'pack'
+ packagesToPack: '**/BlazorTable.csproj'
+ includesymbols: true
+ versioningScheme: 'byPrereleaseNumber'
+ majorVersion: '1'
+ minorVersion: '17'
+ patchVersion: '3'
+ displayName: 'Nuget Push'
+
+- task: NuGetCommand@2
+ inputs:
+ command: 'push'
+ packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
+ nuGetFeedType: 'internal'
+ publishVstsFeed: '62fc85ae-4447-4b56-a2ea-c6ab74293507/dbfc01ad-afcb-448b-bda5-e0ef32ca9d70'
\ No newline at end of file
diff --git a/src/BlazorTable.Sample.Shared/Pages/ServerSideData.razor b/src/BlazorTable.Sample.Shared/Pages/ServerSideData.razor
index 929403e9..c4e4a4a1 100644
--- a/src/BlazorTable.Sample.Shared/Pages/ServerSideData.razor
+++ b/src/BlazorTable.Sample.Shared/Pages/ServerSideData.razor
@@ -6,15 +6,27 @@
Server side data
-
-
-
+Selected: @(selectedItems.Any() ? selectedItems.Select(x => x.full_name).Aggregate((c, n) => $"{c},{n}") : "None")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@context.email
-
+
@context.paid.ToString()
@@ -25,7 +37,7 @@
@(context.created_date.HasValue ? context.created_date.Value.ToShortDateString() : string.Empty)
-
+
@code
@@ -33,6 +45,8 @@
[Inject]
private HttpClient httpClient { get; set; }
+ private ITable Table;
+
public class PersonData
{
public int? id { get; set; }
@@ -47,10 +61,33 @@
private IEnumerable data;
+ private List selectedItems = new List();
+
protected override async Task OnInitializedAsync()
{
_loader = new PersonDataLoader(httpClient);
data = (await _loader.LoadDataAsync(null)).Records;
+
+ await Table.SetInitialFiltersAsync(new List()
+ {
+ //new FilterString()
+ //{
+ // Condition = StringCondition.IsEqualTo.ToString(),
+ // Field = nameof(PersonData.full_name),
+ // FilterValue = "Marja Mustill"
+ //},
+ new FilterString()
+ {
+ Condition = BooleanCondition.True.ToString(),
+ Field = nameof(PersonData.paid)
+ }
+ });
+
+ }
+
+ public void RowClick(PersonData data)
+ {
+ StateHasChanged();
}
public class PersonDataLoader : IDataLoader
@@ -60,7 +97,7 @@
{
_client = client;
}
- public async Task> LoadDataAsync(FilterData parameters)
+ public async Task> LoadDataAsync(FilterData parameters)
{
var data = await _client.GetFromJsonAsync("sample-data/MOCK_DATA.json");
@@ -82,6 +119,13 @@
: query.OrderBy(x => prop.GetValue(x, null));
}
}
+ if(parameters?.Filters != null)
+ {
+ foreach (var filter in parameters?.Filters)
+ {
+ query = query.Where(filter);
+ }
+ }
var results = parameters?.Top.HasValue ?? false ?
query.Skip(parameters.Skip.GetValueOrDefault())
.Take(parameters.Top.Value).ToArray() :
@@ -97,4 +141,6 @@
}
}
+
+
}
diff --git a/src/BlazorTable.Sample.Wasm/wwwroot/css/site.css b/src/BlazorTable.Sample.Wasm/wwwroot/css/site.css
index aa02184c..bde68409 100644
--- a/src/BlazorTable.Sample.Wasm/wwwroot/css/site.css
+++ b/src/BlazorTable.Sample.Wasm/wwwroot/css/site.css
@@ -255,4 +255,8 @@ app {
justify-content: center;
flex-direction: column;
--sk-color: white;
+}
+
+.page-link {
+ border: none;
}
\ No newline at end of file
diff --git a/src/BlazorTable.Sample.Wasm/wwwroot/index.html b/src/BlazorTable.Sample.Wasm/wwwroot/index.html
index b8670c70..82cf2712 100644
--- a/src/BlazorTable.Sample.Wasm/wwwroot/index.html
+++ b/src/BlazorTable.Sample.Wasm/wwwroot/index.html
@@ -7,6 +7,7 @@
+
diff --git a/src/BlazorTable/BlazorTable.csproj b/src/BlazorTable/BlazorTable.csproj
index 4d04d6e9..37cf4d75 100644
--- a/src/BlazorTable/BlazorTable.csproj
+++ b/src/BlazorTable/BlazorTable.csproj
@@ -15,6 +15,8 @@
git
MIT
true
+
+ 1.17.11-preview
@@ -35,6 +37,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/src/BlazorTable/Components/Column.razor.cs b/src/BlazorTable/Components/Column.razor.cs
index dec41914..52137011 100644
--- a/src/BlazorTable/Components/Column.razor.cs
+++ b/src/BlazorTable/Components/Column.razor.cs
@@ -1,4 +1,5 @@
-using Microsoft.AspNetCore.Components;
+using BlazorTable.Components.ServerSide;
+using Microsoft.AspNetCore.Components;
using System;
using System.Globalization;
using System.Linq;
@@ -122,6 +123,16 @@ public string Title
///
public Expression> Filter { get; set; }
+ ///
+ /// Filter as string
+ ///
+ public FilterString FilterString { get; set; }
+
+ ///
+ /// Initial filters
+ ///
+ public FilterString InitialFilterString { get; set; }
+
///
/// True if this is the default Sort Column
///
@@ -147,7 +158,7 @@ public string Title
///
/// Filter Panel is open
///
- public bool FilterOpen { get; private set; }
+ public bool FilterOpen { get; set; }
private bool _visible = true;
@@ -220,6 +231,10 @@ protected override void OnParametersSet()
public void ToggleFilter()
{
FilterOpen = !FilterOpen;
+ foreach (var column in Table.Columns.Where(x => x != this))
+ {
+ column.FilterOpen = false;
+ }
Table.Refresh();
}
diff --git a/src/BlazorTable/Components/FilterManager.razor.cs b/src/BlazorTable/Components/FilterManager.razor.cs
index bb1f8285..7fc24407 100644
--- a/src/BlazorTable/Components/FilterManager.razor.cs
+++ b/src/BlazorTable/Components/FilterManager.razor.cs
@@ -20,13 +20,13 @@ public partial class FilterManager
IStringLocalizer Localization { get; set; }
private async Task ApplyFilterAsync()
-
{
Column.ToggleFilter();
if (Column.FilterControl != null)
{
Column.Filter = Column.FilterControl.GetFilter();
+ Column.FilterString = Column.FilterControl.GetFilterString();
await Column.Table.UpdateAsync().ConfigureAwait(false);
await Column.Table.FirstPageAsync().ConfigureAwait(false);
}
diff --git a/src/BlazorTable/Components/Pager.razor b/src/BlazorTable/Components/Pager.razor
index 8cd3332e..9e83ab82 100644
--- a/src/BlazorTable/Components/Pager.razor
+++ b/src/BlazorTable/Components/Pager.razor
@@ -2,50 +2,78 @@
@if (AlwaysShow || (Table.TotalPages > 1))
{
-
-