Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ public Func<TItem, bool>? ShowDeleteButtonCallback
public bool FixedDetailRowHeaderColumn { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 是否固定 LineNo 列 默认为 false 不固定</para>
/// <para lang="en">Gets or sets Whether to fix LineNo Column. Default false</para>
/// <para lang="zh">获得/设置 是否固定 LineNo 列 默认为 false 不固定,当表格中存在固定列时,该属性值自动设为 true</para>
/// <para lang="en">Gets or sets Whether to fix LineNo Column. Default false.When there are fixed columns in the table, the value of this property is automatically set to true</para>
/// </summary>
[Parameter]
public bool FixedLineNoColumn { get; set; }
Expand Down
11 changes: 10 additions & 1 deletion src/BootstrapBlazor/Components/Table/Table.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ private RenderFragment RenderContentRow(TItem item) => builder =>
// 合并单元格情况
colIndex--;
continue;
}
}

// 获得单元格参数
var cellArgs = GetCellArgs(item, col, ref colIndex);
Expand All @@ -1635,6 +1635,15 @@ private RenderFragment RenderContentRow(TItem item) => builder =>
};

builder.AddContent(0, RenderContentCell(context));

if (ShowLineNo && col.Fixed&& !FixedLineNoColumn)
{
// 当有显示行号列时,且当表格中列固定时,行号列也自动固定
// 避免未设置行号列固定时,表格中其他列固定导致行号列未固定的情况,表格横向滑动时行号会隐藏
FixedLineNoColumn = col.Fixed;
// 这里必须处理一次,以解决持久化加载时,表头先渲染导致固定列不正常
StateHasChanged();
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class TableColumnClientStatus
public List<TableColumnState> Columns { get; set; } = [];

/// <summary>
/// <para lang="zh">表格宽度</para>
/// <para lang="en">Table Width</para>
/// <para lang="zh">表格宽度,当值为 0 时表示表格宽度自适应</para>
/// <para lang="en">Table Width, when the value is 0, it means the table width is auto</para>
/// </summary>
[JsonPropertyName("table")]
public int TableWidth { get; set; }
Expand Down
Loading