You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BlazorApp/Sources/BlazorT/Pages/Table.razor

36 lines
965 B

@page "/table"
<h1>Liste des clients</h1>
<BlazorTable Items="clients" Filter="@filter">
<BlazorTableHeader>
<input type="text" @bind-value="@filter" placeholder="Rechercher..." />
</BlazorTableHeader>
<BlazorTableColumn Field="@nameof(Client.Id)" Title="ID" Sortable="true" />
<BlazorTableColumn Field="@nameof(Client.Name)" Title="Nom" Sortable="true" />
<BlazorTableColumn Field="@nameof(Client.Address)" Title="Adresse" />
</BlazorTable>
@code {
public List<Client> clients = new List<Client>
{
new Client { Id = 1, Name = "John Doe", Address = "123 Main St." },
new Client { Id = 2, Name = "Jane Smith", Address = "456 Elm St." },
new Client { Id = 3, Name = "Bob Johnson", Address = "789 Oak St." }
};
string filter = "";
public class Client
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
}
}