Download the PHP package treetop1500/easyadmin-dragndrop-sort without Composer
On this page you can find all versions of the php package treetop1500/easyadmin-dragndrop-sort. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download treetop1500/easyadmin-dragndrop-sort
More information about treetop1500/easyadmin-dragndrop-sort
Files in treetop1500/easyadmin-dragndrop-sort
Package easyadmin-dragndrop-sort
Short Description A Symfony 4 bundle for allowing drag and drop sorting of entities in list views, incorporating the Sortable Doctrine Extension.
License MIT
Informations about the package easyadmin-dragndrop-sort
Easy Admin Drag 'n Drop Sort
This bundle aims to add drag 'n drop sorting to Easy Admin list views, utilizing the sortable doctrine extensions.
PLEASE NOTE This is still under developement, so use at your own risk.
Getting Started
Installation
Because this bundle is still under development and yet lacks testing, it is not on Packagist at this time, so you'll need to add the repository to your composer.json file:
Next install the bundle via composer:
Install Assets
Configure Gedmo Extensions
You'll need to set up the Gedmo Doctrine Extension for Sortable.
Add Routing
Javascript and CSS
Ensure that the JS and CSS files are inlcuded in your template via your EasyAdmin Config:
...or better yet, compile them into your JS and CSS using webpack or another package manager.
Configure your Entities
All entities should have a $position
property which is used as the primary sort method. This property is annotated as a Gedmo SortablePosition property.
Undo list view sorting in Easy Admin Bundle
Because this method utilizes list position in the table to determine the new sort when dropped, you need to disable column head sorting or things get weird. Easy Admin does not include a way to globally turn this off, however you can disable sorting per column by setting sortable: false
on each property of the list view:
To Do
- Set up a flex recipe that will automatically configure the bundle, add routes, add to the kernel and install assets.
- Extend the configuration to be able to specify which Entity's list views have this functionality.
- Explore better integration into the Easy Admin bundle by way of extension.
- Make the admin prefix more dynamic (currently set to "manage")
- Make the fully qualified class name in the JS more dynamic (currently "App\Entity{Entity}")
- Test with mobile views
- Integrate testing
- Docs
All versions of easyadmin-dragndrop-sort with dependencies
symfony/framework-bundle Version ~4.0
easycorp/easyadmin-bundle Version ~2.3
gedmo/doctrine-extensions Version ^2.4