avikarsha/yii2-datatables

Datatables

dev-master 2017-11-07 08:33 UTC

This package is not auto-updated.

Last update: 2024-04-24 22:38:24 UTC


README

yii2-datatables

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist avikarsha/yii2-datatable "*"

or add

"avikarsha/yii2-datatable": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?php use avikarsha\datatable\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'],
    ],
]);?>```