diff --git a/DbFirst.BlazorWebApp/Components/BandGridBase.cs b/DbFirst.BlazorWebApp/Components/BandGridBase.cs index 5e201e6..3c37f4d 100644 --- a/DbFirst.BlazorWebApp/Components/BandGridBase.cs +++ b/DbFirst.BlazorWebApp/Components/BandGridBase.cs @@ -33,6 +33,7 @@ public abstract class BandGridBase : ComponentBase private readonly Dictionary> _fromCallbacks = new(StringComparer.OrdinalIgnoreCase); private readonly Dictionary> _toCallbacks = new(StringComparer.OrdinalIgnoreCase); private readonly Dictionary> _dateFilterTemplates = new(StringComparer.OrdinalIgnoreCase); + private readonly Dictionary _filterContexts = new(StringComparer.OrdinalIgnoreCase); // --- SizeMode --- protected SizeMode _sizeMode = SizeMode.Medium; @@ -253,8 +254,9 @@ public abstract class BandGridBase : ComponentBase } private RenderFragment BuildDateFilterTemplate(string fieldName) => - _ => b => + ctx => b => { + _filterContexts[fieldName] = ctx; int s = 0; b.OpenElement(s++, "div"); b.AddAttribute(s++, "class", "date-filter-menu p-2"); @@ -322,6 +324,8 @@ public abstract class BandGridBase : ComponentBase }; gridRef?.SetFieldFilterCriteria(fieldName, criteria); + if (_filterContexts.TryGetValue(fieldName, out var ctx)) + ctx.FilterCriteria = criteria; _ = InvokeAsync(StateHasChanged); } diff --git a/DbFirst.BlazorWebApp/wwwroot/app.css b/DbFirst.BlazorWebApp/wwwroot/app.css index 6b6b0cc..72224cc 100644 --- a/DbFirst.BlazorWebApp/wwwroot/app.css +++ b/DbFirst.BlazorWebApp/wwwroot/app.css @@ -294,10 +294,4 @@ html.dx-dark .dxbl-grid > .dxbl-grid-top-panel { .top-row .btn-gap { margin-left: 8px; -} - -/* Date-Filter: nativer Apply/Clear-Footer ausblenden, da Filter sofort bei Datumsauswahl angewendet wird */ -/* .dxbl-dropdown-footer ist der korrekte Selektor für das Filter-Dropdown (nicht .dxbl-popup-buttons-area, das ist für modale Popups) */ -.dxbl-filter-menu-dropdown-root:has(.date-filter-menu) .dxbl-dropdown-footer { - display: none !important; } \ No newline at end of file