apaoww / yii2-jqgrid-widget
A powerful ajax-enabled grid widget for Yii2
Installs: 100
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 15
Type:yii2-extension
Requires
- bower-asset/free-jqgrid: *
- yiisoft/yii2: *
- yiisoft/yii2-jui: *
This package is not auto-updated.
Last update: 2025-01-04 19:53:29 UTC
README
Yii2 wrapper for a powerful ajax-enabled grid free jqGrid jQuery plugin.
Installation
The preferred way to install this extension is through composer.
- Either run
php composer.phar require "apaoww/yii2-jqgrid-widget" "dev-master"
or add
"apaoww/yii2-jqgrid-widget" : "dev-master"
to the require section of your application's composer.json
file.
- Add action in the controller (optional), for example:
use apaoww\jqgrid\actions\JqGridActiveAction; public function actions() { return [ 'jqgrid' => [ 'class' => JqGridActiveAction::className(), 'model' => Page::className(), 'scope' => function ($query) { /** @var \yii\db\ActiveQuery $query */ $query->select(['title', 'author', 'language']); }, ], ]; }
- View's example:
use apaoww\jqgrid\JqGridWidget; use yii\helpers\Url; <?= JqGridWidget::widget([ 'requestUrl' => Url::to('jqgrid'), 'gridSettings' => [ 'colNames' => ['Title', 'Author', 'Language'], 'colModel' => [ ['name' => 'title', 'index' => 'title', 'editable' => true], ['name' => 'author', 'index' => 'author', 'editable' => true], ['name' => 'language', 'index' => 'language', 'editable' => true] ], 'rowNum' => 15, 'autowidth' => true, 'height' => 'auto', ], 'pagerSettings' => [ 'edit' => true, 'add' => true, 'del' => true, 'search' => ['multipleSearch' => true] ], 'enableFilterToolbar' => true, ]) ?>