agik/yii2datatable

yii2的datatable模型

安装: 125

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:yii2-extension

1.0.6 2018-09-07 04:00 UTC

This package is auto-updated.

Last update: 2024-09-11 13:04:29 UTC


README

# ActiveRecord的Datatables



## 控制器或模型上

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();

## 在您的JS文件中

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