tsvetann / sortablegridview
A sortable grid view for Yii2
Installs: 1 122
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=5.4.0
- yiisoft/yii2-jui: *
This package is not auto-updated.
Last update: 2024-04-25 14:18:11 UTC
README
SortableGridview
Yii2 Sortable Gridview
What is sortable gridview
Sometimes one needs a more complex jquery sortable element such that you can filter the elements in a bigger database and then be able to sort the results. Sortable Gridview fulfills this gap
Usage
There is an additional attribute available sortOptions = []
. It takes options from the jquery ui sortable
echo SortableGridview::widget([
'dataProvider' => $dataProvider,
'filterModel' => $filterModel,
'options' => [
'id' => 'targetTable',
'class' => 'grid-view'
],
'sortOptions' => [
'placeholder' => 'ui-state-highlight',
'cursor' => 'move',
'receive' => new JsExpression("function(event, ui) {
console.log('receive');
}"),
'change' => new JsExpression("function(event, ui) {
console.log('change');
}"),
],
'columns' => [
'id',
'title',
],
]);
Installation via composer
require: "tsvetann/sortablegridview": "dev-master"