Optionalconfig: SortableConfigLisnUsageError If there are less than 2 items given or found.
ReadonlydestroyUndoes all modifications to the element and returns it to its original state.
You will need to recreate it if you want to enable its functionality again.
ReadonlydisableDisables the functionality of the widget. What this means is specific to each widget.
ReadonlydisableDisables the given item number. Note that item numbers start at 1.
OptionalcurrentOrder: booleanIf false (default), the item numbers refer to the original order. If true, they refer to the current document order.
ReadonlyenableRe-enables the functionality of the widget. What this means is specific to each widget.
ReadonlyenableRe-enables the given item number. Note that item numbers start at 1.
OptionalcurrentOrder: booleanIf false (default), the item numbers refer to the original order. If true, they refer to the current document order.
ReadonlygetReturns the element passed to the widget constructor.
ReadonlygetReturns the item elements.
OptionalcurrentOrder: booleanIf false (default), returns the items in the original order. If true, they are returned in the current document order.
ReadonlyisReturns true if the widget is destroyed.
ReadonlyisReturns true if the widget is currently disabled.
ReadonlyisReturns true if the given item number is disabled. Note that item numbers start at 1.
OptionalcurrentOrder: booleanIf false (default), the item numbers refer to the original order. If true, they refer to the current document order.
ReadonlyonThe given handler will be called when the widget is destroyed.
ReadonlyonThe given handler will be called when the widget is disabled.
ReadonlyonThe given handler will be called when the widget is enabled.
ReadonlyonThe given handler will be called whenever the user moves an item to
another position. It will be called after the item is moved so
getItems called with currentOrder = true will return the updated
order.
If the handler returns a promise, it will be awaited upon.
ReadonlytoggleRe-enables the widget if disabled, otherwise disables it.
ReadonlytoggleRe-enables the given item number if it is disabled, otherwise disables it. Note that item numbers start at 1.
OptionalcurrentOrder: booleanIf false (default), the item numbers refer to the original order. If true, they refer to the current document order.
Configures the given element as a Sortable widget.
The Sortable widget allows the user to reorder elements by dragging and dropping. It works on touch devices as well. However, it does not yet support automatic scrolling when dragging beyond edge of screen on mobile devices. For this, you may want to use SortableJS instead.
The widget should have more than one draggable item.
IMPORTANT: You should not instantiate more than one Sortable widget on a given element. Use Sortable.get to get an existing instance if any. If there is already a widget instance, it will be destroyed!
You can use the following dynamic attributes or CSS properties in your stylesheet:
The following dynamic attributes are set on each item element:
data-lisn-is-draggable:"true"or"false"(false if the item is disabled)To use with auto-widgets (HTML API) (see settings.autoWidgets), the following CSS classes or data attributes are recognized:
lisn-sortableclass ordata-lisn-sortableattribute set on the container element that constitutes the sortable container.lisn-sortable-itemclass ordata-lisn-sortable-itemattribute set on elements that should act as the items.When using auto-widgets, the elements that will be used as items are discovered in the following way:
lisn-sortable-itemclass ordata-lisn-sortable-itemattribute. They do not have to be immediate children of the root element.scriptandstyleelements) are taken as the items.Example