Skip to content

Commit c8b54a5

Browse files
Make QuickGrid's private CloseColumnOptions into public CloseColumnOptionsAsync
1 parent 9dd4b0f commit c8b54a5

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@{ FinishCollectingColumns(); }
1111
<ColumnsCollectedNotifier TGridItem="TGridItem" />
1212

13-
<table theme="@Theme" aria-rowcount="@(_ariaBodyRowCount + 1)" @ref="_tableReference" @onclosecolumnoptions="CloseColumnOptions" @attributes="AdditionalAttributes" class="@GridClass()">
13+
<table theme="@Theme" aria-rowcount="@(_ariaBodyRowCount + 1)" @ref="_tableReference" @onclosecolumnoptions="CloseColumnOptionsAsync" @attributes="AdditionalAttributes" class="@GridClass()">
1414
<thead>
1515
<tr>
1616
@_renderColumnHeaders

src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,16 @@ public Task ShowColumnOptionsAsync(ColumnBase<TGridItem> column)
272272
return Task.CompletedTask;
273273
}
274274

275+
/// <summary>
276+
/// Closes the <see cref="ColumnBase{TGridItem}.ColumnOptions"/> UI that was previously displayed.
277+
/// </summary>
278+
public Task CloseColumnOptionsAsync()
279+
{
280+
_displayOptionsForColumn = null;
281+
StateHasChanged();
282+
return Task.CompletedTask;
283+
}
284+
275285
/// <summary>
276286
/// Instructs the grid to re-fetch and render the current data from the supplied data source
277287
/// (either <see cref="Items"/> or <see cref="ItemsProvider"/>).
@@ -440,9 +450,4 @@ public async ValueTask DisposeAsync()
440450
// the client disconnected. This is not an error.
441451
}
442452
}
443-
444-
private void CloseColumnOptions()
445-
{
446-
_displayOptionsForColumn = null;
447-
}
448453
}

0 commit comments

Comments
 (0)