-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(Table): add sample code for row span (#5080)
* doc: 增加 MergeTableRow 示例 * doc: 增加行合并示例 Co-Authored-By: Alex chow <zhouchuanglin@gmail.com>
- Loading branch information
1 parent
9864a4f
commit 00e9170
Showing
5 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/BootstrapBlazor.Server/Components/Components/MergeTableRow.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@if (Context.Row.Id == 1) | ||
{ | ||
<tr> | ||
<td rowspan="4">@Context.Row.DateTime</td> | ||
<td>@Context.Row.Name</td> | ||
<td>@Context.Row.Address</td> | ||
<td>@Context.Row.Count</td> | ||
</tr> | ||
} | ||
else if (Context.Row.Id == 2) | ||
{ | ||
<tr> | ||
<td rowspan="3">@Context.Row.Name</td> | ||
<td>@Context.Row.Address</td> | ||
<td>@Context.Row.Count</td> | ||
</tr> | ||
} | ||
else if (Context.Row.Id == 3) | ||
{ | ||
<tr> | ||
<td rowspan="2">@Context.Row.Address</td> | ||
<td>@Context.Row.Count</td> | ||
</tr> | ||
} | ||
else if (Context.Row.Id == 4) | ||
{ | ||
<tr> | ||
<td>@Context.Row.Count</td> | ||
</tr> | ||
} | ||
else | ||
{ | ||
<tr> | ||
<td>@Context.Row.DateTime</td> | ||
<td>@Context.Row.Name</td> | ||
<td>@Context.Row.Address</td> | ||
<td>@Context.Row.Count</td> | ||
</tr> | ||
} |
19 changes: 19 additions & 0 deletions
19
src/BootstrapBlazor.Server/Components/Components/MergeTableRow.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the Apache 2.0 License | ||
// See the LICENSE file in the project root for more information. | ||
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone | ||
|
||
namespace BootstrapBlazor.Server.Components.Components; | ||
|
||
/// <summary> | ||
/// 自定义行组件 | ||
/// </summary> | ||
public partial class MergeTableRow | ||
{ | ||
/// <summary> | ||
/// 获得/设置 行上下文数据实例 | ||
/// </summary> | ||
[Parameter] | ||
[NotNull] | ||
public TableRowContext<Foo>? Context { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters