2017 © Pedro Peláez
 

yii2-extension yii2-jqgrid-widget

A powerful ajax-enabled grid widget for Yii2

image

himiklab/yii2-jqgrid-widget

A powerful ajax-enabled grid widget for Yii2

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 14 Forks
  • 1 Open issues
  • 6 Versions
  • 5 % Grown

The README.md

jqGrid Widget for Yii2

Yii2 wrapper for a powerful ajax-enabled grid free jqGrid jQuery plugin., (*1)

Packagist Packagist license, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

  • Either run
php composer.phar require --prefer-dist "himiklab/yii2-jqgrid-widget" "*"

or add, (*4)

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

to the require section of your application's composer.json file., (*5)

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

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

= JqGridWidget::widget([
    'requestUrl' => Url::to('jqgrid'),
    'gridSettings' => [
        'colNames' => ['ID', 'Title', 'Author', 'Language'],
        'colModel' => [
            [
                'name' => 'id', 'index' => 'id',
                'formatter' => 'integer',
                'searchoptions' => [
                    'searchhidden' => true,
                    'sopt' => ['eq', 'ne', 'lt', 'le', 'gt', 'ge', 'nu', 'nn'],
                ],
                'hidden' => false, 'editable' => false
            ],
            [
                'name' => 'title', 'index' => 'title',
                'searchoptions' => [
                    'searchhidden' => true,
                    'sopt' => ['cn', 'nc', 'bw', 'bn', 'eq', 'ne', 'ew', 'en', 'nu', 'nn'],
                ],
                'hidden' => false, 'editable' => true
            ],
            [
                'name' => 'author', 'index' => 'author',
                'searchoptions' => [
                    'searchhidden' => true,
                    'sopt' => ['cn', 'nc', 'bw', 'bn', 'eq', 'ne', 'ew', 'en', 'nu', 'nn'],
                ],
                'hidden' => false, 'editable' => true
            ],
            [
                'name' => 'language', 'index' => 'language',
                'formatter' => 'select',
                'stype' => 'select',
                'edittype' => 'select',
                'searchoptions' => [
                    'clearSearch' => false,
                    'searchhidden' => true,
                    'value' => ':;en:English;ru:Русский;cn:汉语',
                    'sopt' => ['eq', 'ne', 'nu', 'nn'],
                ],
                'editoptions' => ['value' => [
                    'en' => 'English',
                    'ru' => 'Русский',
                    'cn' => '汉语',
                ]],
                'hidden' => false, 'editable' => true
            ],
        ],
        'rowNum' => 30,
        'rowList' => [30, 60, 90],
        'autowidth' => true,
        'multiselect' => true,
        'multiSort' => true,
        'rownumbers' => true,
        'viewrecords' => true,
        'cmTemplate' => ['autoResizable' => true],
        'autoresizeOnLoad' => true,
    ],
    'pagerSettings' => [
        'edit' => true,
        'add' => true,
        'del' => true,
        'search' => [
            'multipleSearch' => true,
            'multipleGroup' => true,
            'closeAfterSearch' => true,
            'showQuery' => true,
        ]
    ],
    'enableFilterToolbar' => true,
    'enableColumnChooser' => true,
    'filterToolbarSettings' => [
        'stringResult' => true,
    ],
]) ?>

or, (*6)

use app\models\Page;
use himiklab\jqgrid\JqGridHelper;
use himiklab\jqgrid\JqGridWidget;
use yii\helpers\Url;

 ['type' => 'integer',],
    'title',
    'author',
    'language' => [
        'type' => 'list',
        'data' => Page::getAllLanguages(),
    ],
    'visible' => ['type' => 'boolean',],
];

$columnsIsVisible = ['id', 'title', 'author', 'language', 'visible',];
$columnsIsEditable = ['title', 'author', 'language', 'visible',];

echo JqGridWidget::widget([
    'requestUrl' => Url::to('jqgrid'),
    'gridSettings' => [
        'colNames' => ['ID', 'Title', 'Author', 'Language', 'Visible'],
        'colModel' => JqGridHelper::jqgridColModel($columns, $columnsIsVisible, $columnsIsEditable),
        'rowNum' => 30,
        'rowList' => [30, 60, 90],
        'autowidth' => true,
        'multiselect' => true,
        'multiSort' => true,
        'rownumbers' => true,
        'viewrecords' => true,
        'cmTemplate' => ['autoResizable' => true],
        'autoresizeOnLoad' => true,
    ],
    'pagerSettings' => [
        'edit' => true,
        'add' => true,
        'del' => true,
        'search' => [
            'multipleSearch' => true,
            'multipleGroup' => true,
            'closeAfterSearch' => true,
            'showQuery' => true,
        ]
    ],
    'enableFilterToolbar' => true,
    'enableColumnChooser' => true,
    'filterToolbarSettings' => [
        'stringResult' => true,
    ],
]) ?>

The Versions

23/04 2018

dev-master

9999999-dev

A powerful ajax-enabled grid widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget grid jqgrid

02/11 2017

1.1.17

1.1.17.0

A powerful ajax-enabled grid widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget grid jqgrid

27/02 2017

1.1.16

1.1.16.0

A powerful ajax-enabled grid widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget grid jqgrid

30/12 2016

1.1.15

1.1.15.0

A powerful ajax-enabled grid widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget grid jqgrid

09/03 2016

1.1.14

1.1.14.0

A powerful ajax-enabled grid widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget grid jqgrid

01/01 2015

1.0.8

1.0.8.0

A powerful ajax-enabled grid widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget grid jqgrid