RazorKit.DataTables 1.0.4

dotnet add package RazorKit.DataTables --version 1.0.4                
NuGet\Install-Package RazorKit.DataTables -Version 1.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RazorKit.DataTables" Version="1.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RazorKit.DataTables --version 1.0.4                
#r "nuget: RazorKit.DataTables, 1.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RazorKit.DataTables as a Cake Addin
#addin nuget:?package=RazorKit.DataTables&version=1.0.4

// Install RazorKit.DataTables as a Cake Tool
#tool nuget:?package=RazorKit.DataTables&version=1.0.4                

Welcome to RazorKit

RazorKit is a collection of lightweight, fluent-style Razor HTML helpers that make it easy for developers to integrate popular JavaScript libraries into their ASP.NET applications. With RazorKit, you can quickly implement features from libraries like Chart.js and DataTables, without the hassle of writing complex JavaScript or HTML code manually.

Setup DataTables

Install the RazorKit.DataTables package from nuget.

PM> Install-Package RazorKit.DataTables

Add related scripts and style links and implement. Reference:

@using RazorKit

@(Html.DataTable<Person>()
	.Columns(c =>
	{
		c.Field(f => f.Id).Visible(false);
		c.Field(f => f.Name).Title("Name");
	})
	.DataSource(ds => ds
		.URL(Url.Action("GetDataResult"))
		.Method("POST")
		.Naming(Convention.CamelCase))
		.ServerSide(true)
	.Render()
)
using RazorKit.DataTables;

[HttpPost]
public JsonResult GetDataResult(DataRequest request)
{
	var result = ctx.People.ToDataResult(request);
	return Json(result);
}

Setup ChartJs

Install the RazorKit.ChartJs package from nuget.

PM> Install-Package RazorKit.ChartJs

Add related scripts and implement. Reference:

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

@using RazorKit

@(Html.Chart("canvasId")
    .Data(d => d
        .Labels("January", "February", "March", "April", "May", "June", "July")
        .Datasets(ds => ds
            .Line()
            .Label("Line Chart")
            .Data(65, 59, 80, 81, 56, 55, 40)
        )
    )
    .Render()
)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 78 12/18/2024
1.0.3 83 12/16/2024
1.0.2 90 12/7/2024

Improved layout builder.