PHPackages                             treetop1500/easyadmin-dragndrop-sort - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. treetop1500/easyadmin-dragndrop-sort

ActiveSymfony-bundle[Admin Panels](/categories/admin)

treetop1500/easyadmin-dragndrop-sort
====================================

A Symfony 4 bundle for allowing drag and drop sorting of entities in list views, incorporating the Sortable Doctrine Extension.

1.1(6y ago)0479MITJavaScriptPHP ^7.2

Since Aug 14Pushed 6y agoCompare

[ Source](https://github.com/ishapkin/easyadmin-dragndrop-sort)[ Packagist](https://packagist.org/packages/treetop1500/easyadmin-dragndrop-sort)[ RSS](/packages/treetop1500-easyadmin-dragndrop-sort/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

Easy Admin Drag 'n Drop 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
---------------

[](#getting-started)

### Installation

[](#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:

```
// composer.json
{
"repositories": [
        {
            "url": "https://github.com/treetop1500/easyadmin-dragndrop-sort.git",
            "type": "git"
        }
    ]
}

```

Next install the bundle via composer:

```
composer require treetop1500/easyadmin-dragndrop-sort

```

Install Assets

```
bin/console assets:install --symlink

```

### Configure Gedmo Extensions

[](#configure-gedmo-extensions)

You'll need to set up the [Gedmo Doctrine Extension](https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/symfony2.md) for Sortable.

### Add Routing

[](#add-routing)

```
easyadmin_dragndrop_sort:
  resource: "@Treetop1500EasyadminDragndropSortBundle/Controller"
  type:     annotation
  prefix: /manage

```

### Javascript and CSS

[](#javascript-and-css)

Ensure that the JS and CSS files are inlcuded in your template via your EasyAdmin Config:

```
//config/packages/easy_admin.yml
easy_admin:
  design:
    assets:
      css:
        - '/bundles/treetop1500easyadmindragndropsort/stylesheets/easyadmin-dragndrop-sort.css'
      js:
        - '/bundles/treetop1500easyadmindragndropsort/javascripts/easyadmin-dragndrop-sort.js'
        - 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-toggle/2.2.2/js/bootstrap2-toggle.min.js'

```

...or better yet, compile them into your JS and CSS using webpack or another package manager.

```
// assets/js/app-admin.js
require('../../public/bundles/treetop1500easyadmindragndropsort/stylesheets/easyadmin-dragndrop-sort.css');
require('../../public/bundles/treetop1500easyadmindragndropsort/javascripts/easyadmin-dragndrop-sort.js');
require('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-toggle/2.2.2/js/bootstrap2-toggle.min.js');

```

### Configure your Entities

[](#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.

```
