From 8db9fc3f17c571bf2cb77e37f2fd0a5b2c3ad801 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Tue, 1 Aug 2023 11:08:49 +0300 Subject: [PATCH] other filtering demos improved to respect auto-filter setting in template filters --- RadzenBlazorDemos/Pages/DataFilterLoadData.razor | 16 ++++++++++++++-- RadzenBlazorDemos/Pages/DataFilterOData.razor | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/RadzenBlazorDemos/Pages/DataFilterLoadData.razor b/RadzenBlazorDemos/Pages/DataFilterLoadData.razor index 24d1737ac02..0b741b76b34 100644 --- a/RadzenBlazorDemos/Pages/DataFilterLoadData.razor +++ b/RadzenBlazorDemos/Pages/DataFilterLoadData.razor @@ -9,14 +9,14 @@ - + ordersGrid.Reload())> - titles = new List { "Sales Representative", "Vice President, Sales", "Sales Manager", "Inside Sales Coordinator" }; IEnumerable selectedTitles; + IEnumerable finalSelectedTitles; async Task OnSelectedTitlesChange(object value) { @@ -77,9 +78,20 @@ selectedTitles = null; } + if (auto) + { + finalSelectedTitles = selectedTitles; + } + await ordersGrid.FirstPage(); } + async Task ApplyFilter() + { + finalSelectedTitles = selectedTitles; + await dataFilter.Filter(); + } + protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); diff --git a/RadzenBlazorDemos/Pages/DataFilterOData.razor b/RadzenBlazorDemos/Pages/DataFilterOData.razor index dacbce9ccff..382ad0df91d 100644 --- a/RadzenBlazorDemos/Pages/DataFilterOData.razor +++ b/RadzenBlazorDemos/Pages/DataFilterOData.razor @@ -8,14 +8,14 @@ - + ordersGrid.Reload())> - titles = new List { "Sales Representative", "Vice President, Sales", "Sales Manager", "Inside Sales Coordinator" }; IEnumerable selectedTitles; + IEnumerable finalSelectedTitles; async Task OnSelectedTitlesChange(object value) { @@ -76,9 +77,20 @@ selectedTitles = null; } + if (auto) + { + finalSelectedTitles = selectedTitles; + } + await ordersGrid.FirstPage(); } + async Task ApplyFilter() + { + finalSelectedTitles = selectedTitles; + await dataFilter.Filter(); + } + protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender);