Skip to content

Commit 297e154

Browse files
authored
#798: Grid default loading placeholder updates + row selection related updates (#800)
1 parent 69a51c6 commit 297e154

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

blazorbootstrap/Components/Grid/Grid.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@
8585
{
8686
@if (loadingTemplate is null)
8787
{
88+
var placeholderRowCount = AllowPaging ? pageSize : (totalCount < 10 ? totalCount : 10);
89+
8890
// show placeholders
89-
@for (var i = 0; i < 5; i++)
91+
@for (var i = 0; i < placeholderRowCount; i++)
9092
{
9193
<tr>
9294
@for (var j = 0; j < columnCount; j++)

blazorbootstrap/Components/Grid/Grid.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private RenderFragment ChildSelectionTemplate(int rowIndex, TItem rowData) =>
258258
builder.AddAttribute(103, "class", $"form-check bb-grid-form-check-{headerCheckboxId}");
259259

260260
builder.OpenElement(104, "input");
261-
builder.AddAttribute(105, "class", "form-check-input");
261+
builder.AddAttribute(105, "class", "form-check-input bb-grid-form-check-input");
262262
builder.AddAttribute(106, "type", "checkbox");
263263
builder.AddAttribute(107, "role", "button");
264264

blazorbootstrap/wwwroot/blazor.bootstrap.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,16 @@ table button.dropdown-toggle.bb-grid-filter::after {
141141
--bs-table-bg: inherit !important;
142142
}
143143

144-
.bb-table tr:has(input[type=checkbox]:checked) {
144+
.bb-table > tbody tr:has(input[type=checkbox].bb-grid-form-check-input:checked) {
145145
color: var(--bb-table-selected-row-color);
146146
background-color: var(--bb-table-selected-row-background-color);
147147
}
148148

149-
.bb-table tr:has(input[type=checkbox]:checked):hover,
150-
.bb-table tr:has(input[type=checkbox]:checked):hover > * {
151-
color: var(--bb-table-selected-row-hover-color);
152-
background-color: var(--bb-table-selected-row-hover-background-color);
153-
}
149+
.bb-table > tbody tr:has(input[type=checkbox].bb-grid-form-check-input:checked):hover,
150+
.bb-table > tbody tr:has(input[type=checkbox].bb-grid-form-check-input:checked):hover > * {
151+
color: var(--bb-table-selected-row-hover-color);
152+
background-color: var(--bb-table-selected-row-hover-background-color);
153+
}
154154

155155
.bb-table-sticky {
156156
border-collapse: collapse;

0 commit comments

Comments
 (0)