Skip to content

Commit 4e228b6

Browse files
committed
fix(Table): add toggleView function
1 parent bc0f9fe commit 4e228b6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/BootstrapBlazor/Components/Table/Table.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
933933
if(_viewChanged)
934934
{
935935
_viewChanged = false;
936-
await InvokeVoidAsync("reset", Id);
936+
await InvokeVoidAsync("toggleView", Id);
937937
}
938938

939939
if (_breakPointChanged)

src/BootstrapBlazor/Components/Table/Table.razor.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,21 @@ export function scrollTo(id, x = 0, y = 0, options = { behavior: 'smooth' }) {
198198
}
199199
}
200200

201+
export function toggleView(id) {
202+
const table = Data.get(id);
203+
destoryTable(table);
204+
205+
reset(id);
206+
}
207+
201208
export function dispose(id) {
202209
const table = Data.get(id)
203-
Data.remove(id)
210+
Data.remove(id);
211+
212+
destoryTable(table);
213+
}
204214

215+
const destoryTable = table => {
205216
if (table) {
206217
if (table.loopCheckHeightHandler) {
207218
cancelAnimationFrame(table.loopCheckHeightHandler);

0 commit comments

Comments
 (0)