PHPackages                             jlorente/yii2-datatables - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jlorente/yii2-datatables

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

jlorente/yii2-datatables
========================

A Yii2 extension to provide the framework with the JQuery DataTables plugin

1.0.1(3y ago)3105MITPHP

Since Nov 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jlorente/yii2-datatables)[ Packagist](https://packagist.org/packages/jlorente/yii2-datatables)[ RSS](/packages/jlorente-yii2-datatables/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

DataTables widget for Yii2
==========================

[](#datatables-widget-for-yii2)

The extension is inspired by the [yii2-widget-datatables](https://github.com/fedemotta/yii2-widget-datatables) by [fedemotta](https://github.com/fedemotta).

This extension provides the [DataTables](https://github.com/DataTables/DataTables) integration for the Yii2 framework.

[![Latest Stable Version](https://camo.githubusercontent.com/73253a63f90915106a98c8dc7d7e140c102593bd2b80fd13409465d0b053e823/68747470733a2f2f706f7365722e707567782e6f72672f6a6c6f72656e74652f796969322d646174617461626c65732f762f737461626c65)](https://packagist.org/packages/jlorente/yii2-datatables) [![Total Downloads](https://camo.githubusercontent.com/59ef3ab2118d264755b0f90449eb5c7de29856fa002d77c6f0dadc4b4ce72e2d/68747470733a2f2f706f7365722e707567782e6f72672f6a6c6f72656e74652f796969322d646174617461626c65732f646f776e6c6f616473)](https://packagist.org/packages/jlorente/yii2-datatables) [![Latest Unstable Version](https://camo.githubusercontent.com/d8f8b327264dc488cae4d458e0ce81828a6be6911c0479d9fc5bc277facb3dfb/68747470733a2f2f706f7365722e707567782e6f72672f6a6c6f72656e74652f796969322d646174617461626c65732f762f756e737461626c65)](https://packagist.org/packages/jlorente/yii2-datatables) [![License](https://camo.githubusercontent.com/d3cf03a3bbbe03cd229decdc4806389963e03c2f6a0c6aa05dec2b6faa39ebdb/68747470733a2f2f706f7365722e707567782e6f72672f6a6c6f72656e74652f796969322d646174617461626c65732f6c6963656e7365)](https://packagist.org/packages/jlorente/yii2-datatables)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

With Composer installed, you can then install the extension using the following commands:

```
$ php composer.phar require jlorente/yii2-datatables "*"
```

or add

```
...
    "require": {
        // ... other configurations ...
        "jlorente/yii2-datatables": "*"
    }
```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

Use DataTables as any other other Yii2 widget.

```
use jlorente\datatables\grid\DataTables;
```

```
$searchModel = new ModelSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);

DataTables::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],

        //columns

        ['class' => 'yii\grid\ActionColumn'],
    ],
]);
```

This extension uses the Bootstrap integration plugin to provide a Yii2 style by default.

The TableTools plugin is also available. Specify the DOM and the tableTools settings in the clientOptions array as the following example.

```
DataTables::widget([
    //Other configurations
    'clientOptions' => [
        "lengthMenu"=> [[20,-1], [20,Yii::t('app',"All")]],
        "info"=>false,
        "responsive"=>true,
        "dom"=> 'lfTrtip',
        "tableTools"=>[
            "aButtons"=> [
                [
                "sExtends"=> "copy",
                "sButtonText"=> Yii::t('app',"Copy to clipboard")
                ],[
                "sExtends"=> "csv",
                "sButtonText"=> Yii::t('app',"Save to CSV")
                ],[
                "sExtends"=> "xls",
                "oSelectorOpts"=> ["page"=> 'current']
                ],[
                "sExtends"=> "pdf",
                "sButtonText"=> Yii::t('app',"Save to PDF")
                ],[
                "sExtends"=> "print",
                "sButtonText"=> Yii::t('app',"Print")
                ],
            ]
        ]
    ],
]);
```

You can also use DataTables in the JavaScript layer of your application. To achieve this, you need to include DataTables as a dependency of your Asset file. In this case, you could use yii\\grid\\GridView or using the datatables options retrieve =&gt; true to avoid errors. In both case all options must be in the Javascript object.

```
public $depends = [
...
    'jlorente\datatables\assets\DataTablesAsset',
...
];
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5b6d568331349beaf1945db65a076cf60e6c124d504fcb43a21937f0c85bde3?d=identicon)[jlorente](/maintainers/jlorente)

---

Top Contributors

[![fedemotta](https://avatars.githubusercontent.com/u/250785?v=4)](https://github.com/fedemotta "fedemotta (25 commits)")[![jlorente](https://avatars.githubusercontent.com/u/301741?v=4)](https://github.com/jlorente "jlorente (16 commits)")

---

Tags

javascriptlibraryjquerydatatablesyii2extensiontable

### Embed Badge

![Health badge](/badges/jlorente-yii2-datatables/health.svg)

```
[![Health](https://phpackages.com/badges/jlorente-yii2-datatables/health.svg)](https://phpackages.com/packages/jlorente-yii2-datatables)
```

###  Alternatives

[fedemotta/yii2-widget-datatables

DataTables widget for Yii2

34179.4k1](/packages/fedemotta-yii2-widget-datatables)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-sortable-input

Sortable input widget based on yii2-sortable extension.

24660.4k2](/packages/kartik-v-yii2-sortable-input)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
