2017 © Pedro Peláez
 

yii2-extension yii2-sortable-grid-view

Yii2 GridView widget base on jQuery UI sortable widget

image

oonne/yii2-sortable-grid-view

Yii2 GridView widget base on jQuery UI sortable widget

  • Friday, May 4, 2018
  • by onehejay
  • Repository
  • 1 Watchers
  • 0 Stars
  • 159 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 38 % Grown

The README.md

Sortable GridView Widget for Yii2

Yii2 GridView widget base on jQuery UI sortable widget., (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist "oonne/yii2-sortable-grid-view" "*"

or add, (*4)

"oonne/yii2-sortable-grid-view" : "*"

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

Usage

  • Add to your database new unsigned int attribute, such sequence., (*6)

  • Add new behavior in the active record model, for example:, (*7)

use oonne\sortablegrid\SortableGridBehavior;

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

public function actions()
{
    return [
        'sort' => [
            'class' => SortableGridAction::className(),
            'modelName' => Model::className(),
        ],
    ];
}
  • Add SortableGridView in the view, for example:
use oonne\sortablegrid\SortableGridView;

SortableGridView::widget([
    'dataProvider' => $dataProvider,
    'sortableAction' => ['/bannersuper/sort'],
    'columns' => [
        [
            'class' => 'yii\grid\SerialColumn',
            'contentOptions' => ['class' => 'sortable-handle'],
        ],
        [
            'attribute' => 'sName',
        ],
    ]
])

The Versions

04/05 2018

dev-master

9999999-dev

Yii2 GridView widget base on jQuery UI sortable widget

  Sources   Download

MIT

The Requires

 

yii2 widget sortable gridview

19/07 2017

1.0.0

1.0.0.0

Yii2 GridView widget base on jQuery UI sortable widget

  Sources   Download

MIT

The Requires

 

yii2 widget sortable gridview