dev-master
9999999-devSortable column for Yii2 GridView
MIT
The Requires
by Aleksandr Solovyov
yii2 widget grid
v1.0.0
1.0.0.0Sortable column for Yii2 GridView
MIT
The Requires
by Aleksandr Solovyov
Wallogit.com
2017 © Pedro Peláez
Sortable column for Yii2 GridView
The GridView column class for sorting rows. Looks like this:, (*2)
, (*3)
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)
<?= GridView::widget([
'id' => 'gridview',
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[ 'class' => 'kl83\grid\SortableColumn' ],
'title',
'type',
[ 'class' => 'yii\grid\ActionColumn' ],
],
]); ?>
$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
});
});
");
MIT License, (*8)
Sortable column for Yii2 GridView
MIT
yii2 widget grid
Sortable column for Yii2 GridView
MIT