A Blazor interop library for DataTables
MIT License
This library simplifies the integration of DataTables into Blazor applications, providing access to options, events, etc. A demo project showcasing common usages is included.
Diligence was taken to align the Blazor API with JS. Refer to the DataTables documentation for details. This is a work-in-progress; contribution is welcomed.
dotnet add package Soenneker.Blazor.DataTables
Startup.cs
filepublic void ConfigureServices(IServiceCollection services)
{
services.AddDataTables();
}
@using Soenneker.Blazor.DataTables
<DataTable Options="_options">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>Developer</td>
<td>London</td>
<td>28</td>
<td>2017/04/25</td>
<td>$320,800</td>
</tr>
</tbody>
</DataTable>
@code{
private readonly DataTableOptions _options_ = new()
{
Searching = true,
LengthChange = false,
Info = false,
Paging = false,
Order = [new object[] {0, "asc"}]
};
}