Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
<DemoBlock Title="@Localizer["AllowResizingTitle"]"
Introduction="@Localizer["AllowResizingIntro"]"
Name="AllowResizing">
<p class="mb-3">@((MarkupString)Localizer["AllowResizingDesc"].Value)</p>
<section ignore class="mb-3">@((MarkupString)Localizer["AllowResizingDesc"].Value)</section>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@PageItemsSource" AllowResizing="true"
IsPagination="true" PageItemsSource="@PageItemsSource"
AllowResizing="true" ClientTableName="table-test"
IsStriped="true" IsBordered="true" RenderMode="TableRenderMode.Table"
ShowToolbar="false" IsMultipleSelect="true"
OnQueryAsync="@OnQueryAsync">
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -4822,7 +4822,7 @@
"WidthP3": "通过设置按钮 <code>IsShow</code> 参数来控制是否显示按钮",
"AllowResizingTitle": "允许列调整",
"AllowResizingIntro": "通过指定 <code>AllowResizing</code> 设置表格列允许调整宽度",
"AllowResizingDesc": "<b>注意:</b> <code>Table</code> 父容器有有效宽度值时 <code>Table</code> 才会出现滚动条",
"AllowResizingDesc": "<b>注意:</b> <code>Table</code> 父容器有有效宽度值时 <code>Table</code> 才会出现滚动条,可通过设置 <code>ClientTableName</code> 参数开启本地化存储列宽功能,即通过拖拽后列宽下次打开时会保持",
"WidthButtonText1": "明细",
"WidthButtonText2": "编辑",
"WidthButtonText3": "权限",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>8.0.3-beta02</Version>
<Version>8.0.3-beta03</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
Expand Down
8 changes: 4 additions & 4 deletions src/BootstrapBlazor/Components/Table/Table.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public void ExpandDetailRow(TItem item)
/// 获得/设置 表格名称 默认 null 用于列宽持久化功能
/// </summary>
[Parameter]
public string? TableName { get; set; }
public string? ClientTableName { get; set; }

[CascadingParameter]
[NotNull]
Expand Down Expand Up @@ -836,14 +836,14 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
? $"width: {_localStorageTableWidth.Value}px;"
: null;

private string? GetTableName(bool hasHeader) => hasHeader ? TableName : null;
private string? GetTableName(bool hasHeader) => hasHeader ? ClientTableName : null;

private async Task<IEnumerable<ColumnWidth>> ReloadColumnWidth()
{
IEnumerable<ColumnWidth>? ret = null;
if (!string.IsNullOrEmpty(TableName) && AllowResizing)
if (!string.IsNullOrEmpty(ClientTableName) && AllowResizing)
{
var jsonData = await InvokeAsync<string>("reloadColumnWidth", Id, TableName);
var jsonData = await InvokeAsync<string>("reloadColumnWidth", Id, ClientTableName);
if (!string.IsNullOrEmpty(jsonData))
{
try
Expand Down
5 changes: 3 additions & 2 deletions src/BootstrapBlazor/Components/Table/Table.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,11 @@ export function sort(id) {
export function load(id, method) {
const table = Data.get(id)

const loader = table.el.querySelector('.table-loader')
const loader = [...table.el.children].find(el => el.classList.contains('table-loader'));
if (method === 'show') {
loader.classList.add('show')
} else {
}
else {
loader.classList.remove('show')
}
}
Expand Down