Download the PHP package morning-bird/yii2-sortable-gridview without Composer
On this page you can find all versions of the php package morning-bird/yii2-sortable-gridview. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download morning-bird/yii2-sortable-gridview
More information about morning-bird/yii2-sortable-gridview
Files in morning-bird/yii2-sortable-gridview
Package yii2-sortable-gridview
Short Description Sortable GridView for Yii2
License MIT
Informations about the package yii2-sortable-gridview
yii2-sortable-gridview
This is an extension of Yii2 GridView.
This extension render a sortable GridView which you can drag and drop the record items from the list, and store the order in ActiveRecord.
Getting Started
Installing
Install with Composer:
composer require morning-bird/yii2-sortable-gridview "*"
or
php composer.phar require morning-bird/yii2-sortable-gridview "*"
or add
"morning-bird/yii2-sortable-gridview":"*"
to the require section of your composer.json file.
Setting up SortableAction
In your controller, add the SortableAction into action():
Setting up SortableGridView
In the view file, use SortableGridView as using the Yii default GridView
You may also want to disable the pagination of data provider, in order to allow reordering across pages.
You can do it by calling below before passing data provider into SortableGridView
Configurations
SortableAction
example:
- activeRecordClassName (required)The ActiveRecrod class name. Use the full class name with namespace.
- orderColumn (required) The column name which store the sorting order of each records. The column should be integer.
SortableGridView
example:
- sortUrl (required) The URL link to the SortableAction defined in controller's action().
- sortingPromptText (optional) The text shown in the model while the server is reordering model. You can use HTML tag in this attribute. Default to "Loading...".
- failText (optional) The text shown in alert box when sorting failed. Default to "Fail to sort".
License
yii2-sortable-gridview is released under the MIT License. See the bundled LICENSE for details.