Add selection to file table

dhcp-server
Pat Hartl 2023-09-10 02:16:53 -05:00
parent 81bf3265db
commit bd5f1a16ec
1 changed files with 5 additions and 0 deletions

View File

@ -84,7 +84,9 @@
HidePagination="true" HidePagination="true"
Loading="Entries == null" Loading="Entries == null"
OnRow="OnRow" OnRow="OnRow"
@bind-SelectedRows="Selected"
Size="@TableSize.Small"> Size="@TableSize.Small">
<Selection Key="@context.Path" Type="@(SelectMultiple ? "checkbox" : "radio")" />
<Column TData="string" Width="32"> <Column TData="string" Width="32">
@if (context is FileManagerFile) @if (context is FileManagerFile)
{ {
@ -110,6 +112,9 @@
@code { @code {
[Parameter] public Guid ArchiveId { get; set; } [Parameter] public Guid ArchiveId { get; set; }
[Parameter] public string WorkingDirectory { get; set; } [Parameter] public string WorkingDirectory { get; set; }
[Parameter] public bool SelectMultiple { get; set; } = true;
[Parameter] public IEnumerable<IFileManagerEntry> Selected { get; set; } = new List<IFileManagerEntry>();
[Parameter] public EventCallback<IEnumerable<IFileManagerEntry>> SelectedChanged { get; set; }
FileManagerDirectory Path { get; set; } FileManagerDirectory Path { get; set; }