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

  1. Installation
  2. Usage
  3. Resources

Yii2 wrapper for a powerful ajax-enabled grid 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.

Usage

  • Add action in the controller (optional), for example:
use himiklab\jqgrid\actions\JqGridActiveAction;

public function actions()
{
    return [
        'jqgrid' => [
            'class' => JqGridActiveAction::className(),
            'model' => Page::className(),
            'columns' => ['title', 'author', 'language']
        ],
    ];
}
  • View's example
use himiklab\jqgrid\JqGridWidget;

<?= JqGridWidget::widget([
    'requestUrl' => 'admin/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
]); ?>

Resources

0 0
8 followers
0 downloads
Yii Version: 2.0
License: MIT
Category: User Interface
Developed by: himiklab
Created on: Sep 30, 2014
Last updated: 10 years ago

Related Extensions