ember-sortablejs

1.3.1 • Public • Published

ember-sortablejs

Build Status Ember Observer Score

This addon allows you to use drag and drop in your ember application using SortableJS/Sortable

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above

Installation

ember install ember-sortablejs

Usage

<SortableJs
  @options={{hash animation=150 ghostClass="ghost-class" group="shared-list"}}
  @onChoose={{action "trigger" "onChoose"}}
  @onUnchoose={{action "trigger" "onUnchoose"}}
  @onStart={{action "trigger" "onStart"}}
  @onEnd={{action "trigger" "onEnd"}}
  @onAdd={{action "trigger" "onAdd"}}
  @onUpdate={{action "trigger" "onUpdate"}}
  @onRemove={{action "trigger" "onRemove"}}
  @onMove={{action "trigger" "onMove"}}
  @onClone={{action "trigger" "onClone"}}
  @onChange={{action "trigger" "onChange"}}
  as |sortable|
>
  <ul class="list-group">
    <li class="list-group-item bg-yellow">Item 1</li>
    <li class="list-group-item bg-yellow">Item 2</li>
    <li class="list-group-item bg-yellow">Item 3</li>
    <li class="list-group-item bg-yellow">Item 4</li>
    <li class="list-group-item bg-yellow">Item 5</li>
  </ul>
</SortableJs>

Options

The addon supports all the options that sortable accepts, see: https://github.com/SortableJS/Sortable#options

Options are passed using the {{hash}} helper.

The events:

  • onChoose
  • onUnchoose
  • onStart
  • onEnd
  • onAdd
  • onUpdate
  • onSort
  • onRemove
  • onMove
  • onClone
  • onChange
  • scrollFn
  • onSetData
  • setData
  • onFilter

Should be in the component signature as closure actions. All actions get the events as described in the SortableJS docs as the sortable instance.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i ember-sortablejs

Weekly Downloads

509

Version

1.3.1

License

GPL-3.0-only

Unpacked Size

64.5 kB

Total Files

12

Last publish

Collaborators

  • lvegerano