aurelia-sortablejs
Aurelia plugin to use the sortablejs library.
Installation
Aurelia-CLI (RequireJS)
Install the package:
au install aurelia-sortablejs
Add the following line to src/main.js
or src/main.ts
:
export function configure(aurelia: Aurelia) { aurelia.use .standardConfiguration() .feature('resources')+ .plugin('aurelia-sortablejs'); if (environment.debug) { aurelia.use.developmentLogging(); }
Aurelia-CLI (SystemJS)
Install the package:
au install aurelia-sortablejs
Add the following line to src/main.js
or src/main.ts
:
export function configure(aurelia: Aurelia) { aurelia.use .standardConfiguration() .feature('resources')+ .plugin('aurelia-sortablejs'); if (environment.debug) { aurelia.use.developmentLogging(); }
Aurelia-CLI (Webpack)
Install the package:
yarn add aurelia-sortablejs
Add the following line to src/main.js
or src/main.ts
:
export function configure(aurelia: Aurelia) { aurelia.use .standardConfiguration() .feature(PLATFORM.moduleName('resources'))+ .plugin(PLATFORM.moduleName('aurelia-sortablejs')); if (environment.debug) { aurelia.use.developmentLogging(); }
Usage:
one two three
Each event can be used in the following way:
one two three
public { let event = customEventdetail; console; }
sortable
The following attributes can be set to catch events
Attribute | Sortablejs event | Description |
---|---|---|
sortable-add | onAdd | Element is dropped into the list from another list |
sortable-end | onEnd | Dragging ended |
sortable-filter | onFilter | Attempt to drag a filtered element |
sortable-move | onMove | Event when you move an item in the list or between lists |
sortable-remove | onRemove | Element is removed from the list into another list |
sortable-sort | onSort | Called by any change to the list (add / update / remove) |
sortable-start | onStart | Dragging started |
sortable-update | onUpdate | Changed sorting within list |