2017 © Pedro Peláez
 

yii2-extension yii2-grid-view-sort

Sortable modification of standard Yii2 GridView widget

image

octoweb/yii2-grid-view-sort

Sortable modification of standard Yii2 GridView widget

  • Friday, October 9, 2015
  • by OctoWeb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 21 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % 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 "octoweb/yii2-grid-view-sort" "*"

or add, (*3)

"octoweb/yii2-grid-view-sort" : "*"

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 octoweb\gridsort\SortableGridBehavior;

public function behaviors()
{
    return [
        'sort' => [
            'class' => SortableGridBehavior::className(),
            'sortableAttribute' => 'sortOrder'
        ],
    ];
}
  • Add action in the controller, for example:
use octoweb\gridsort\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.

The Versions

09/10 2015

dev-master

9999999-dev

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

by Octo Web

yii2 grid sortable gridview

09/10 2015

1.0.1

1.0.1.0

Sortable modification of standard Yii2 GridView widget

  Sources   Download

MIT

The Requires

 

by Octo Web

yii2 grid sortable gridview