Download the PHP package sem-soft/yii2-sortable without Composer
On this page you can find all versions of the php package sem-soft/yii2-sortable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sem-soft/yii2-sortable
More information about sem-soft/yii2-sortable
Files in sem-soft/yii2-sortable
Package yii2-sortable
Short Description Full sortable pack for managing entities ordering by specific attribute and grouping filter
License BSD-3-Clause
Informations about the package yii2-sortable
yii2-sortable
Full sortable pack for managing entities ordering by specific attribute and grouping filter
Usage
Next, an example of using the entire Sortable package
Tables migration
-
Table with simple one filed order column 'sort'
- Table with complex sorting group fields 'sort' and 'document_group_id'
Models configuration
Include simple rule for 'sort' field and special behavior setting.
-
Model with simple ordering by 'sort' field
- Model with complex grouping ordering by two fields: 'document_group_id' and 'sort'
Controller special actions configuration
Their is several special actions for reordering entities. Configuration of this actions may be done in controller method. Don't forgot about RBAC and filtering permissions for this actions
-
Step based actions. These actions allow move entity upstair and downstair by one step only. The example below shows the configuration of two actions with a complex grouping anonymous sort function.
- Drag and drop action. This action allow move entity in randomly place in list. Example below.
Widgets
All widgets adapted to work with Pjax tech.
-
GridView widget with Step-based ordering buttons.
When Primary key of sortable entity is composite the ActionColumn buttons url configuration look like the following:
- SortableGridView widget. Allows Drag and Drop selected entity over his table list. Also support Pjax. Widget detects Pjax sorround automaticly. Now, this widget supports only GET-method. In the future, POST-method support will be added.