Skip to content

Commit

Permalink
#1013 [HxListLayout] To allow to open filter Offcanvas from outside
Browse files Browse the repository at this point in the history
  • Loading branch information
hakenr committed Feb 11, 2025
1 parent d0cfa11 commit 4624b96
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
@if (FilterTemplate != null)
{
<HxButton Settings="FilterOpenButtonSettingsEffective" OnClick="HandleFilterButtonClick" />
<HxButton Settings="FilterOpenButtonSettingsEffective" OnClick="ShowFilterOffcanvas" />
}
</div>
@if (FilterModel != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ private async Task HandleChipRemoveClick(ChipItem chipItemToRemove)
await _filterForm.RemoveChipAsync(chipItemToRemove);
}

private async Task HandleFilterButtonClick()
{
await _filterOffcanvasComponent.ShowAsync();
}

private async Task HandleFilterFormModelChanged(TFilterModel newFilterModel)
{
// We want the offcanvas to close before the filter model is updated (= before the data start reloading).
Expand All @@ -173,4 +168,20 @@ private async Task HandleNamedViewClickAsync(NamedView<TFilterModel> namedView)
await InvokeFilterModelChangedAsync(newFilterModel);
}
}

/// <summary>
/// Opens the filter offcanvas.
/// </summary>
public async Task ShowFilterOffcanvas()
{
await _filterOffcanvasComponent.ShowAsync();
}

/// <summary>
/// Closes the filter offcanvas.
/// </summary>
public async Task HideFilterOffcanvas()
{
await _filterOffcanvasComponent.HideAsync();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7372,6 +7372,16 @@
Additional CSS classes for the wrapping <c>div</c>.
</summary>
</member>
<member name="M:Havit.Blazor.Components.Web.Bootstrap.HxListLayout`1.ShowFilterOffcanvas">
<summary>
Opens the filter offcanvas.
</summary>
</member>
<member name="M:Havit.Blazor.Components.Web.Bootstrap.HxListLayout`1.HideFilterOffcanvas">
<summary>
Closes the filter offcanvas.
</summary>
</member>
<member name="T:Havit.Blazor.Components.Web.Bootstrap.ILayoutColumnComponent">
<summary>
Interface for column-sized components (e.g. <see cref="T:Havit.Blazor.Components.Web.Bootstrap.HxPlaceholder"/>).
Expand Down

0 comments on commit 4624b96

Please sign in to comment.