dev-master
9999999-devSortable modification of standard Yii2 ListView widget
MIT
The Requires
by handysolver
yii2 widget list sortable listview
Sortable modification of standard Yii2 ListView widget
Sortable modification of standard Yii2 ListView widget., (*1)
This library has been picked up from himiklab's gridview sortable and has been customised to work with ListView. Great work himiklab!, (*2)
The preferred way to install this extension is through composer., (*3)
php composer.phar require --prefer-dist "handysolver/yii2-sortable-list-view-widget" "*"
or add, (*4)
"handysolver/yii2-sortable-list-view-widget" : "*"
to the require
section of your application's composer.json
file., (*5)
Add to your database new unsigned int
attribute, such sortOrder
., (*6)
Add new behavior in the AR model, for example:, (*7)
use handysolver\sortablelist\SortableListBehavior; public function behaviors() { return [ 'sort' => [ 'class' => SortableListBehavior::className(), 'sortableAttribute' => 'sortOrder' ], ]; }
use handysolver\sortablelist\SortableListAction; public function actions() { return [ 'sort' => [ 'class' => SortableListAction::className(), 'modelName' => Model::className(), ], ]; }
sortableAction
option.
You can also subscribe to the JS event 'sortableSuccess' generated widget after a successful sorting.Sortable modification of standard Yii2 ListView widget
MIT
yii2 widget list sortable listview