consultnn/yii2-custom-grid

Yii2 GridView with plugin support

v1.3.1 2020-03-17 14:48 UTC

This package is auto-updated.

Last update: 2024-12-18 01:43:46 UTC


README

Plugin system for Yii2 GridView

Installation

The preferred way to install this extension is through composer.

Add dependence

"consultnn/yii2-custom-grid": "*"

to the require section of your composer.json file.

Existing plug-ins

Configuration

  1. Add grid view in your view with plugins parameter
echo consultnn\grid\GridView::widget(
    [
        'dataProvider' => $dataProvider,
        'filterModel' => $model,
        'plugins' => [
            \consultnn\grid\plugins\ResizableColumns::className(),
            [
                'class' => \consultnn\grid\plugins\Settings::className(),
                'url' => \yii\helpers\Url::to('/company/settings'),
                'storage' => Yii::$app->user->identity->settings,
                'activeColumns' => ['_id', 'name', 'type']
            ]
        ]
    ]
);
  1. Plugins attribute contains array of enabled component plugins.

About every supported plugin you may read in plugins docs

License

Auth module is released under the MIT License. See the bundled LICENSE.md for details.