DatatableJS 3.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package DatatableJS --version 3.0.1
NuGet\Install-Package DatatableJS -Version 3.0.1
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="DatatableJS" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DatatableJS --version 3.0.1
#r "nuget: DatatableJS, 3.0.1"
#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 DatatableJS as a Cake Addin
#addin nuget:?package=DatatableJS&version=3.0.1

// Install DatatableJS as a Cake Tool
#tool nuget:?package=DatatableJS&version=3.0.1

DatatableJS

Build status NuGet Codacy Badge Gitter

What is DatatableJS?

DatatableJS is a helper to create a grid with Jquery Datatable and provides an extension to retrive data generically from Entity Framework context. It possible to use many datatable.js features with Html helper. It gives serverside or client side options. There's more: Wiki Documentation

Ekran Alıntısı

Where can I get it?

Install DatatableJS for .Net Core, .Net 5, .Net 6 and use tag helpers.

PM> Install-Package DatatableJS
<datatable name="PersonGrid">
    <columns>
        <column field="Id" visible="false" />
        <column field="Name" width="50" title="Full Name" />
        <column field="Age" />
        <command-item field="Id" on-click="onClick" btn-class="btn btn-info" text="Edit" icon-class="fa fa-edit"/>
        <commands field="Id" text="Actions" items='new [] { new Command("Update", "onClick"), new Command("Delete", "onClick") }'/>
    </columns>
    <data-source url="@Url.Action("GetDataResult")" method="POST" server-side="true" data="addParam"/>
    <language url="//cdn.datatables.net/plug-ins/1.10.22/i18n/Turkish.json"/>
    <filters>
        <add field="Id" value="1" operand="GreaterThanOrEqual"/>
    </filters>
    <captions top="top caption here" bottom="bottom caption here"/>
    <render />
</datatable>

Or, Install DatatableJS.Net for .Net Frameworks (4.5 ... 4.8) from the package manager console:

PM> Install-Package DatatableJS.Net
@(Html.JS().Datatable<Person>()
        .Name("PersonGrid")
        .Columns(col =>
        {
            col.Field(a => a.Id).Visible(false);
            col.Field(a => a.Name).Title("First Name").Class("text-danger");
            col.Field(a => a.Age).Title("Age").Searchable(false);
            col.Field(a => a.BirthDate).Title("Birth Date").Format("DD-MMM-Y");
            col.Command(a => a.Id, "onClick", text: "Click").Title("");
        })
        .Filters(filter =>
        {
            filter.Add(a => a.Id).GreaterThanOrEqual(1);
        })
        .URL(Url.Action("GetDataResult"), "POST")
        .ServerSide(true)
        .Render()
)

Using .ToDataResult(request) extension function with IQueryable collection, provides data can get with server side pagination very simply. To use this feature install DatatableJS.Data from the package manager console:

PM> Install-Package DatatableJS.Data
using DatatableJS.Data

public JsonResult GetDataResult(DataRequest request)
{
    DataResult result = context.People.ToDataResult(request);
    return Json(result);
}

Then add datatables.net Javascript and CSS files or links to your project.

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script>
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
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
3.8.1 124 3/24/2024
3.8.0 755 6/28/2023
3.7.0 1,210 5/3/2023
3.6.1 311 3/11/2023
3.6.0 616 1/22/2023
3.4.1 411 12/17/2022
3.4.0 280 12/8/2022
3.3.2 291 11/21/2022
3.3.1 845 10/22/2022
3.3.0 385 10/20/2022
3.2.5 542 8/5/2022
3.2.4 480 7/14/2022
3.2.3 1,359 1/16/2022
3.2.2 550 1/13/2022
3.2.1 259 1/2/2022
3.1.0 560 11/21/2021
3.0.1 307 10/21/2021
3.0.0 367 10/10/2021

enabled summaries