Download the PHP package torfs-ict/ea-sortable-bundle without Composer
On this page you can find all versions of the php package torfs-ict/ea-sortable-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download torfs-ict/ea-sortable-bundle
More information about torfs-ict/ea-sortable-bundle
Files in torfs-ict/ea-sortable-bundle
Package ea-sortable-bundle
Short Description Sortable entities in EasyAdmin bundle with drag-and-drop interface
License MIT
Informations about the package ea-sortable-bundle
EasyAdmin sortable bundle
This bundle provides a convenient way to make your entities sortable as well as a drag-and-drop in the EasyAdmin list view.
The javascript and css was copied from treetop1500/easyadmin-dragndrop-sort with some minor improvements.
Installation
Install the bundle using composer:
Add the bundle routing to config/routes.yaml:
Usage
Using the sortable trait
Add the Orkestra\EaSortable\SortableTrait trait to your entity. Below is the sample configuration for
EasyAdmin.
Some notes about the configuration:
- setting the
sortoption is mandatory, obviously - you need to provide the custom
sortaction in order to enable the drag-and-drop functionality - sorting must be disabled on all other list fields (there is no way to do this globally in EasyAdmin)
Without the sortable trait
As long as your sorting property is called position you can simply follow the same steps as when
using the sortable trait. If not you need to do the following things:
- change the property in the
sortoption - configure the property on the
sortaction
The following example assumes the sorting property is named index.
All versions of ea-sortable-bundle with dependencies
sensio/framework-extra-bundle Version ^5.1
stof/doctrine-extensions-bundle Version ^1.3