Skip to content

Commit

Permalink
Added fixed headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Feb 20, 2024
1 parent 075f28a commit d807464
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
PagerOptions="@(new DataGridPagerOptions { PaginationPosition = PagerElementPosition.Center, ButtonRowPosition = PagerElementPosition.Start, TotalItemsPosition = PagerElementPosition.End })"
PageSizes="@PageSizes"
Filterable="@Filterable"
CustomFilter="@OnCustomFilter"
Sortable="@Sortable"
Responsive
Editable="@Editable"
Expand All @@ -25,7 +24,8 @@
DataGridColumns="@DataGridColumns"
ButtonRowTemplate="@ButtonRowTemplate"
DetailRowTemplate="@DetailRowTemplate"
DetailRowTrigger="@DetailRowTrigger">
DetailRowTrigger="@DetailRowTrigger"
FixedHeader="@FixedHeader">
<TotalItemsTemplate>
@if (Metadata.TotalCount == 0)
{
Expand Down Expand Up @@ -63,6 +63,9 @@
[Parameter]
public bool Sortable { get; set; } = false;

[Parameter]
public bool FixedHeader { get; set; } = false;

[Parameter(CaptureUnmatchedValues = true)]
public Dictionary<string, object>? AdditionalAttributes { get; set; }

Expand Down Expand Up @@ -149,6 +152,4 @@
return GetPageSize?.Invoke(userSettings) ?? userSettings.PageSize;
}

private static bool OnCustomFilter(TItem model) => true;

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging @ref="@_dataGridRef" TItem="QuartzExecutionLogEntity" DetailRowTrigger="@(x => x.Item.LogId == _dataGridRef?.Value?.LogId)" GetFilters="@GetFilters" GetItems="@Paging" Sortable Filterable>
<DataGridPaging @ref="@_dataGridRef" TItem="QuartzExecutionLogEntity" DetailRowTrigger="@(x => x.Item.LogId == _dataGridRef?.Value?.LogId)" GetFilters="@GetFilters" GetItems="@Paging" Sortable Filterable FixedHeader>
<DataGridColumns>
<DataGridColumn TItem="QuartzExecutionLogEntity" ElementId="job-name" Field="@nameof(QuartzExecutionLogEntity.JobName)" Caption="" Filterable="@false" Sortable="@false" >
<DisplayTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<CardTitle Size="4" Margin="@Margin.Is0">Allowed User Module Ids</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsUserToModuleManualLinkModel" GetItems="@GetAllowUserMods">
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsUserToModuleManualLinkModel" GetItems="@GetAllowUserMods" FixedHeader>
<DataGridColumns>
<DataGridColumnText TItem="NexusModsUserToModuleManualLinkModel" Field="@nameof(NexusModsUserToModuleManualLinkModel.NexusModsUserId)" Caption="User Id"/>
<DataGridColumnText TItem="NexusModsUserToModuleManualLinkModel" Field="@nameof(NexusModsUserToModuleManualLinkModel.AllowedModuleIds)" Caption="Allowed Module Ids">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<CardTitle Size="4" Margin="@Margin.Is0">Manual Module Id Links</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsModToModuleModel" GetItems="@GetManualLinks">
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsModToModuleModel" GetItems="@GetManualLinks" FixedHeader>
<DataGridColumns>
<DataGridColumn TItem="NexusModsModToModuleModel" Field="@nameof(NexusModsModToModuleModel.ModuleId)" Caption="Module Id"/>
<DataGridColumn TItem="NexusModsModToModuleModel" Field="@nameof(NexusModsModToModuleModel.NexusModsModId)" Caption="Mod Id"/>
Expand Down
2 changes: 1 addition & 1 deletion src/BUTR.Site.NexusMods.Client/Pages/Tools/Articles.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging TItem="NexusModsArticleModel" @ref="@_dataGridPagingRef" GetFilters="@GetFilters" GetItems="@GetArticles" Sortable Filterable>
<DataGridPaging TItem="NexusModsArticleModel" @ref="@_dataGridPagingRef" GetFilters="@GetFilters" GetItems="@GetArticles" Sortable Filterable FixedHeader>
<DataGridColumns>
<DataGridColumnText TItem="NexusModsArticleModel" Field="@nameof(NexusModsArticleModel.NexusModsArticleId)" Caption="Id" Sortable SortField="@nameof(EntityFields.NexusModsArticleId)"/>
<DataGridColumnText TItem="NexusModsArticleModel" ElementId="article-title" Field="@nameof(NexusModsArticleModel.Title)" Caption="Title" Filterable Sortable SortField="@nameof(EntityFields.Title)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<CardTitle Size="4" Margin="@Margin.Is0">Exposed Mods</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging TItem="ExposedNexusModsModModel" @ref="@_dataGridPagingRef" GetFilters="@GetFilters" GetItems="@GetExposedMods" Sortable Filterable>
<DataGridPaging TItem="ExposedNexusModsModModel" @ref="@_dataGridPagingRef" GetFilters="@GetFilters" GetItems="@GetExposedMods" Sortable Filterable FixedHeader>
<DataGridColumns>
<DataGridColumnText TItem="ExposedNexusModsModModel" ElementId="mod-id" Field="@nameof(ExposedNexusModsModModel.NexusModsModId)" Caption="NexusMods Mod Id" Filterable Sortable SortField="@nameof(EntityFields.NexusModsModId)"/>
<DataGridColumnTextAutocomplete TItem="ExposedNexusModsModModel" ElementId="module-id" Field="@nameof(ExposedNexusModsModModel.Mods)" Caption="Module Id's" Filterable Sortable SortField="@nameof(EntityFields.ModuleId)" MinLength="3" GetAutocompleteValues="GetAutocompleteValues">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<CardTitle Size="4" Margin="@Margin.Is0">Allowed Mods to Users</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsUserToNexusModsModManualLinkModel" GetItems="@GetAllowUserMods" >
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsUserToNexusModsModManualLinkModel" GetItems="@GetAllowUserMods" FixedHeader>
<DataGridColumns>
<DataGridColumnText TItem="NexusModsUserToNexusModsModManualLinkModel" Field="@nameof(NexusModsUserToNexusModsModManualLinkModel.NexusModsModId)" Caption="Mod Id"/>
<DataGridColumnText TItem="NexusModsUserToNexusModsModManualLinkModel" Field="@nameof(NexusModsUserToNexusModsModManualLinkModel.AllowedNexusModsUserIds)" Caption="Allowed User Ids">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</CardTitle>
</CardHeader>
<CardBody>
<DataGridStreamingPaging @ref="@_datagridPagingRef" TItem="CrashReportModel2" GetFilters="@GetFilters" GetItems="@GetCrashReports" Sortable Filterable DefaultPageSize="@UserSettings.DefaultCrashReportPageSize" PageSizes="@UserSettings.AvailableCrashReportPageSizes" GetPageSize="@(x => x.CrashReportPageSize)">
<DataGridStreamingPaging @ref="@_datagridPagingRef" TItem="CrashReportModel2" GetFilters="@GetFilters" GetItems="@GetCrashReports" Sortable Filterable DefaultPageSize="@UserSettings.DefaultCrashReportPageSize" PageSizes="@UserSettings.AvailableCrashReportPageSizes" GetPageSize="@(x => x.CrashReportPageSize)" FixedHeader>
<DataGridColumns>
<DataGridColumnText TItem="CrashReportModel2" ElementId="game-version" Field="@nameof(CrashReportModel2.GameVersion)" Caption="Game Version" Filterable Placeholder="v1.0.0" Sortable SortField="@nameof(EntityFields.GameVersion)"/>
<DataGridColumnTextAutocomplete TItem="CrashReportModel2" Field="@nameof(CrashReportModel2.InvolvedModules)" Caption="Top Involved Module" Filterable Sortable SortField="@nameof(EntityFields.TopInvolvedModuleId)" MinLength="3" GetAutocompleteValues="@GetAutocompleteValues">
Expand Down
4 changes: 2 additions & 2 deletions src/BUTR.Site.NexusMods.Client/Pages/User/Mods.razor
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<CardTitle Size="4" Margin="@Margin.Is0">Linked Mods</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsModModel" GetItems="@GetMods">
<DataGridPaging @ref="@_dataGridRef" TItem="NexusModsModModel" GetItems="@GetMods" FixedHeader>
<DataGridColumns>
<DataGridColumn TItem="NexusModsModModel" ElementId="mod-id" Field="@nameof(NexusModsModModel.NexusModsModId)" Caption="Mod Id"/>
<DataGridColumn TItem="NexusModsModModel" ElementId="mod-name" Field="@nameof(NexusModsModModel.Name)" Caption="Name"/>
Expand Down Expand Up @@ -67,7 +67,7 @@
<CardTitle Size="4" Margin="@Margin.Is0">Available Mods</CardTitle>
</CardHeader>
<CardBody>
<DataGridPaging @ref="@_dataGridRef2" TItem="NexusModsModAvailableModel" GetItems="@GetAllowedMods" PageSizes="@(new[] { 5, 10, 20 })">
<DataGridPaging @ref="@_dataGridRef2" TItem="NexusModsModAvailableModel" GetItems="@GetAllowedMods" PageSizes="@(new[] { 5, 10, 20 })" FixedHeader>
<DataGridColumns>
<DataGridColumn TItem="NexusModsModAvailableModel" ElementId="mod-id" Field="@nameof(NexusModsModAvailableModel.NexusModsModId)" Caption="Mod Id"/>
<DataGridColumn TItem="NexusModsModAvailableModel" ElementId="mod-name" Field="@nameof(NexusModsModAvailableModel.Name)" Caption="Name"/>
Expand Down
2 changes: 0 additions & 2 deletions src/BUTR.Site.NexusMods.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Blazorise;
using Blazorise.Bootstrap5;
using Blazorise.Icons.FontAwesome;
using Blazorise.Localization;

using BUTR.Site.NexusMods.Client.Extensions;
using BUTR.Site.NexusMods.Client.Options;
Expand All @@ -14,7 +13,6 @@
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Microsoft.JSInterop;

Expand Down

0 comments on commit d807464

Please sign in to comment.