Skip to content

A sortable Marionette.CollectionView powered by jQuery UI Sortable or HTML5 Sortable.

License

Notifications You must be signed in to change notification settings

orangain/marionette-sortable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Marionette Sortable

A sortable Marionette.CollectionView powered by jQuery UI Sortable or HTML5 Sortable.

Demo

Requirements

Usage

Load marionette-sortable.js and other dependencies.

<script src="marionette-sortable.js"></script>

Extend your CollectionView from Marionette.SortableCollectionView. Note that html5sortable: true is required when using HTML5 Sortable.

var YourCollectionView = Marionette.SortableCollectionView.extend({

  ...

  // Optional object to be passed to the $.sortable()'s argument.
  sortableOptions: {
    html5sortable: true // Required when using HTML5 Sortable.
  }

});

As a Behavior (mixin)

Marionette Sortable also provides Marionette.SortableBehavior. This enable you to make sortable any Marionette.CollectionViews without inheriting Marionette.SortableCollectionView. Note that html5sortable: true is required when using HTML5 Sortable.

var YourCollectionView = Marionette.CollectionView.extend({

  ...

  behaviors: {
    Sortable: {
      behaviorClass: Marionette.SortableBehavior,
      html5sortable: true // Required when using HTML5 Sortable.
    }
  }

});

About

A sortable Marionette.CollectionView powered by jQuery UI Sortable or HTML5 Sortable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages