2017 © Pedro Peláez
 

library yii2-grid-sortable-column

Sortable column for Yii2 GridView

image

kl83/yii2-grid-sortable-column

Sortable column for Yii2 GridView

  • Saturday, December 2, 2017
  • by kl83
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 32 % Grown

The README.md

Yii2 GridView sortable column

Latest Stable Version Total Downloads License, (*1)

The GridView column class for sorting rows. Looks like this:, (*2)

Preview, (*3)

Installation

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

Either run, (*5)

php composer.phar require kl83/yii2-grid-sortable-column ~1.0.0

or add, (*6)

"kl83/yii2-grid-sortable-column": "~1.0.0"

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

Usage

Add column

<?= GridView::widget([
    'id' => 'gridview',
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        [ 'class' => 'kl83\grid\SortableColumn' ],
        'title',
        'type',
        [ 'class' => 'yii\grid\ActionColumn' ],
    ],
]); ?>

Listen GridView event

$this->registerJs("
    $('#gridview').bind('sortablecolumn-sort', function ( e, data ) {
        // Sending data to the server
        $.get('/move-row', {
            itemId: data.itemId, // The key of the dragged row
            prevId: data.prevId, // The key of the previous row, false if the row is the first
            nextId: data.nextId  // The key of the next row, false if the row is the last
        });
    });
");

License

MIT License, (*8)

The Versions

02/12 2017

dev-master

9999999-dev

Sortable column for Yii2 GridView

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov

yii2 widget grid

04/07 2017

v1.0.0

1.0.0.0

Sortable column for Yii2 GridView

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov