2017 © Pedro Peláez
 

yii2-extension yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

image

kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  • Monday, May 28, 2018
  • by kartik-v
  • Repository
  • 7 Watchers
  • 58 Stars
  • 268,964 Installations
  • PHP
  • 29 Dependents
  • 0 Suggesters
  • 58 Forks
  • 26 Open issues
  • 17 Versions
  • 12 % Grown

The README.md

Krajee Logo
yii2-dynagrid
Donate       kartikv

Latest Stable Version Latest Unstable Version License Total Downloads Monthly Downloads Daily Downloads, (*1)

The yii2-dynagrid module is a great complementary addition to the kartik-v/yii2-grid module, enhancing it with personalization features. It turbo charges your grid view by making it dynamic and personalized for each user. It allows users the ability to set and save their own grid configuration. The major features provided by this module are:, (*2)

  • Personalize, set, and save grid page size at runtime. You can set the minimum and maximum page size allowed.
  • Personalize, set, and save grid data filters at runtime. A user can define and save his/her own personalized grid data filters.
  • Personalize, set, and save grid column sorts at runtime. A user can define and save his/her own personalized grid column sorts.
  • Personalize the grid columns display through drag and drop. Reorder grid columns and set the visibility of needed columns, and allow users to save this setting. Control which columns can be reordered by users through predefined columns setup. Predetermine which of your desired columns will be always fixed to the left or right by default.
  • Personalize grid appearance and set the grid theme. This will offer advanced customization to the grid layout. It allows users to virtually style grid anyway they want, based on how you define themes and extend them to your users. Since the extension uses the yii2-grid extension,it offers all the styling options the yii2-grid extension provides, including the various grid column enhancements, bootstrap panels, and other grid styles. This will allow you to easily setup themes for users in many ways. You have an ability to setup multiple themes in your module configuration, and allow users to select one of them. The extension by default includes some predefined themes for you to get started.
  • Allow you to save the dynamic grid configuration specific to each user or global level. Implements a DynaGridStore object to manage dynagrid personalizations independent of storage. One of the following storage options are made available to store the personalized grid configuration:
    • Session Storage (default)
    • Cookie Storage
    • Database Storage
  • The extension automatically validates and loads the saved configuration based on the stored settings.

NOTE: This extension depends on the kartik-v/yii2-grid and kartik-v/yii2-sortable extensions which in turn depends on the yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies., (*3)

Latest Release

Refer the CHANGE LOG for details on changes to various releases. - With v1.2.0, the Dynagrid is revamped to include a DynaGridStore object and ability to save, update, or delete grid personalizations including grid filter and sort. - With v1.1.0, the DynaGrid includes Pjax support. To enable Pjax processing, set gridOptions['pjax'] property to true and control pjax behavior using gridOptions['pjaxSettings']., (*4)

How to contribute via a pull request?

Refer this git workflow for contributors., (*5)

Demo

You can see detailed documentation, view the API Code Documentation or view a complete demo on usage of the extension., (*6)

Installation

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

Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json., (*8)

Either run, (*9)

$ php composer.phar require kartik-v/yii2-dynagrid "@dev"

or add, (*10)

"kartik-v/yii2-dynagrid": "@dev"

to the require section of your composer.json file., (*11)

Usage

Module

Setup the module in your Yii configuration file with a name dynagrid as shown below. In addition, you must also register the gridview module as described in the yii2-grid documentation., (*12)

'modules'=>[
   'dynagrid'=>[
        'class'=>'\kartik\dynagrid\Module',
        // other settings (refer documentation)
    ],
    'gridview'=>[
        'class'=>'\kartik\grid\Module',
        // other module settings
    ],
],

DynaGrid

The DynaGrid widget can be used to render the personalized & dynamic version of kartik\Grid\GridView in the following way:, (*13)

use kartik\dynagrid\DynaGrid;
use kartik\grid\GridView;
$columns = [
    ['class'=>'kartik\grid\SerialColumn', 'order'=>DynaGrid::ORDER_FIX_LEFT],
    'id',
    'name',
    [
        'attribute'=>'publish_date',
        'filterType'=>GridView::FILTER_DATE,
        'format'=>'raw',
        'width'=>'170px',
        'filterWidgetOptions'=>[
            'pluginOptions'=>['format'=>'yyyy-mm-dd']
        ],
    ],
    [
        'class'=>'kartik\grid\BooleanColumn',
        'attribute'=>'status', 
        'vAlign'=>'middle',
    ],
    [
        'class'=>'kartik\grid\ActionColumn',
        'dropdown'=>false,
        'order'=>DynaGrid::ORDER_FIX_RIGHT
    ],
    ['class'=>'kartik\grid\CheckboxColumn',  'order'=>DynaGrid::ORDER_FIX_RIGHT],
];

echo DynaGrid::widget([
    'columns'=>$columns,
    'storage'=>DynaGrid::TYPE_COOKIE,
    'theme'=>'panel-danger',
    'gridOptions'=>[
        'dataProvider'=>$dataProvider,
        'filterModel'=>$searchModel,
        'panel'=>['heading'=>'<h3 class="panel-title">Library</h3>'],
    ],
    'options'=>['id'=>'dynagrid-1'] // a unique identifier is important
]);

Warning: You need to be careful, in case you are using the new \kartik\grid\FormulaColumn in your grid layout. The reordering of columns by users will render your formulae invalid, since the column indices will change. It is recommended, you set the order of all such formulae columns and its dependencies to DynaGrid::ORDER_FIX_LEFT, so that such column positions are pre-fixed., (*14)

License

yii2-dynagrid is released under the BSD-3-Clause License. See the bundled LICENSE.md for details., (*15)

The Versions

28/05 2018

dev-master

9999999-dev https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

15/02 2018

v1.4.8

1.4.8.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

23/10 2017

v1.4.7

1.4.7.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

15/09 2017

v1.4.6

1.4.6.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

16/08 2017

dev-revert-163-master

dev-revert-163-master https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

06/04 2017

v1.4.5

1.4.5.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

04/08 2015

v1.4.4

1.4.4.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

16/06 2015

v1.4.3

1.4.3.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

22/05 2015

v1.4.2

1.4.2.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

13/02 2015

v1.4.1

1.4.1.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

12/01 2015

v1.4.0

1.4.0.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

25/11 2014

1.3.0.x-dev

1.3.0.9999999-dev https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

25/11 2014

v1.3.0

1.3.0.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

05/10 2014

1.1.0.x-dev

1.1.0.9999999-dev https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

05/10 2014

v1.1.0

1.1.0.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

20/09 2014

1.0.0.x-dev

1.0.0.9999999-dev https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder

20/09 2014

v1.0.0

1.0.0.0 https://github.com/kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 widget grid show dynamic sort order visibility hide columns reorder