2017 © Pedro Peláez
 

yii2-extension yii2-sortable-grid-view-widget

Sortable modification of standard Yii2 GridView widget

image

twixoff/yii2-sortable-grid-view-widget

Sortable modification of standard Yii2 GridView widget

  • Wednesday, December 6, 2017
  • by twixoff
  • Repository
  • 1 Watchers
  • 0 Stars
  • 82 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 33 Forks
  • 0 Open issues
  • 7 Versions
  • 12 % Grown

The README.md

Sortable GridView Widget for Yii2

Sortable modification of standard Yii2 GridView widget., (*1)

Installation

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

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

or add, (*3)

"himiklab/yii2-sortable-grid-view-widget" : "*"

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

  • Add to your database new unsigned int attribute, such sortOrder., (*5)

  • Add new behavior in the AR model, for example:, (*6)

use himiklab\sortablegrid\SortableGridBehavior;

public function behaviors()
{
    return [
        'sort' => [
            'class' => SortableGridBehavior::className(),
            'sortableAttribute' => 'sortOrder',
            'scopeAttribute' => 'parentId'            
        ],
    ];
}
  • Add action in the controller, for example:
use himiklab\sortablegrid\SortableGridAction;

public function actions()
{
    return [
        'sort' => [
            'class' => SortableGridAction::className(),
            'modelName' => Model::className(),
        ],
    ];
}

Usage

  • Use SortableGridView as standard GridView with sortableAction option. You can also subscribe to the JS event 'sortableSuccess' generated widget after a successful sorting.

Scopes

Sometimes a table contains sort orders for multiple scopes. For example, a list of filters linked to a specific category. The scopeAttribute can be used to segment the sequence list. New items automatically get the next sort order in the segment., (*7)

The Versions

06/12 2017

dev-master

9999999-dev

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

yii2 widget grid sortable gridview

06/12 2017

1.0.11

1.0.11.0

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

yii2 widget grid sortable gridview

14/02 2016

1.0.10

1.0.10.0

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

yii2 widget grid sortable gridview

17/11 2015

1.0.9

1.0.9.0

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

yii2 widget grid sortable gridview

13/10 2015

1.0.7

1.0.7.0

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

yii2 widget grid sortable gridview

13/10 2015

1.0.8

1.0.8.0

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

yii2 widget grid sortable gridview

27/01 2015

1.0.6

1.0.6.0

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

yii2 widget grid sortable gridview