megapixel23/kendo-yii2-adapter
Composer 安装命令:
composer require megapixel23/kendo-yii2-adapter
包简介
Kendo Grid adapter for Yii2
README 文档
README
It is a adapter for Yii2 that transforms Kendo Grid`s frontend requests into ActiveQuery on backend. Supports all KendoGrid`s filtering, sorting, searching etc.
Kendo Grid docs
Instalation
- Add following line into
requiresection in yourcomposer.json:
"require": { "megapixel23/kendo-yii2-adapter": "dev-master" }
- If you want to install package directly from GitHub, you need to add following line into
repositoriessection in yourcomposer.jsonto set up composer`s package source path:
"repositories": [ { "type": "git", "url": "https://github.com/MEGApixel23/kendo-yii2-adapter" } ]
Basic Usage
Frontend
var grid = $("#grid").kendoGrid({ dataSource: { type: 'json', transport: { read: '/custom/action/handler' }, schema: { data: 'data', total: 'total' }, pageSize: 20, serverPaging: true, serverFiltering: true }, filterable: { mode: 'row' }, pageable: true }).data('kendoGrid');
Backend
public function actionCustomActionHandler() { if (Yii::$app->request->isAjax) { Yii::$app->response->format = 'json'; $query = Items::find(); $provider = new KendoDataProvider([ 'query' => $query ]); return [ 'data' => $provider->getModels(), 'total' => $query->count() ]; } }
统计信息
- 总下载量: 262
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-12-15