himiklab/yii2-jqgrid-widget A powerful ajax-enabled grid widget for Yii2

widgetgridjqgridajax

jqGrid Widget for Yii2

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 --prefer-dist "himiklab/yii2-jqgrid-widget" "*"

or add

"himiklab/yii2-jqgrid-widget" : "*"

to the require section of your application's composer.json file.

  • Add action in the controller (optional), for example:
use himiklab\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 himiklab\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,
]) ?>

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.1.17 is the latest of 20 releases



MIT license
Stats
20 github stars & 12 github forks
1 downloads in the last day
90 downloads in the last 30 days
1242 total downloads