Skip to content

Simple sortable DOM elements in Dart using HTML5 drag and drop

License

Notifications You must be signed in to change notification settings

sirctseb/assortment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assortment

Simple sortable DOM elements in Dart using HTML5 drag and drop

Usage

To use this library in your code :

  • add a dependency in your pubspec.yaml :
dependencies:
  assortment: ">=0.1.0 <1.0.0"
  • add import in your dart code :
import 'package:assortment/assortment.dart';
  • create an Assortment within an element
var a = new Assortment(querySelector('#sortable-container'));
  • add children to the Assortment
a.addElements(querySelectorAll('#sortable-container .sortable-entry'));
  • rearrange elements by dragging and dropping

  • listen for events to run code during drags

a.onDragEnter.listen((AssortmentEvent event) {
  // update model
}

About

Simple sortable DOM elements in Dart using HTML5 drag and drop

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages