All Components

SortableService

The service that provides the dragging functionality between multiple Sortables on the same page.

Methods

finishMove

The finishMove is called by the SortableComponent when the dragging is completed.

Parameters

target SortableComponent

The SortableComponent where the item is dropped.

getSortableComponentFromTouch

The method that finds the SortableComponent which is registered to the SortableService by using the arguments of the touch event.

Parameters

touch Touch

A Touch - Object of type Touch interface. Represents a single contact point (finger or stylus) on a touch-sensitive device (touchscreen or trackpad).

Returns

{ component: SortableComponent; index: number; } An object where the component is the SortableComponent that owns the item and the index is the index of the touched item.

getSource

Returns the SortableComponent that is currently set as the Source for dragging an item between all Sortable components.

Returns

SortableComponent The SourceCompoennt

initMove

The initMove is called by the SortableComponents when an item is being dragged from one SortableComponent to another.

Parameters

target SortableComponent

The target SortableComponent.

index number

The index of the item that is being dragged.

registerComponent

Registers a SortableComponent for the service to operate with.

Parameters

sortableComponent SortableComponent

The SortableComponent.

Returns

string The unique Key that the current SortableComponent gets when registered.

setSource

Sets the SortableComponent as a Source component. When dragging an item from one Sortable to another, the source component is the one from which the item originates.

Parameters

sortable SortableComponent

The SortableComponent.

unregisterComponent

Removes a SortableComponent from the registered SortableComponents the service operates with.

Parameters

key string

The key of the SortableComponent that is to be removed from the register. This key is obtained when registerComponent is called.

In this article