agik/yii2datatable

datatable yii2 models

1.0.6 2018-09-07 04:00 UTC

This package is auto-updated.

Last update: 2024-11-11 13:22:59 UTC


README

#Datatables with ActiveRecord Yii2



##On Controller or Model

use app\models\LevelAccess; 
use agik\yii2datatable\Table;
$dt=new Table(LevelAccess::find());
//if using join
$dt->model->joinWith('menu');
//if using join
$dt->model->joinWith('levelUser');
 return $dt->getRow();

##On your JS File

var tb=$('#table').dataTable({
				"ajax": {
          "url": "http://",
          'type':'get'
        },
        "serverSide":true/false,
        columns:[
{"data":"table_name.column_name"}
        ]
    });