Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • sortablejs

Index

Constructors

constructor

  • Sortable's main constructor.

    Parameters

    • element: HTMLElement

      Any variety of HTMLElement.

    • options: sortablejs.Options

      Sortable options object.

    Returns sortablejs

Properties

el

el: HTMLElement

options

Static active

active: null | sortablejs

Static clone

clone: null | HTMLElement

The clone element.

Static dragged

dragged: null | HTMLElement

The element being dragged.

Static ghost

ghost: null | HTMLElement

The ghost element.

Static utils

utils: Utils

Static Readonly version

version: string

Get the Sortable version

Methods

closest

  • closest(element: HTMLElement, selector?: string): null | HTMLElement
  • For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.

    Parameters

    • element: HTMLElement

      an HTMLElement or selector string.

    • Optional selector: string

      default: options.draggable

    Returns null | HTMLElement

destroy

  • destroy(): void
  • Removes the sortable functionality completely.

    Returns void

option

  • Options getter/setter

    Type parameters

    Parameters

    Returns void

  • Type parameters

    Parameters

    • name: K

    Returns sortablejs.Options[K]

save

  • save(): void
  • Saving and restoring of the sort.

    Returns void

sort

  • sort(order: readonly string[]): void
  • Sorts the elements according to the array.

    Parameters

    • order: readonly string[]

      an array of strings to sort.

    Returns void

toArray

  • toArray(): string[]
  • Serializes the sortable's item data-id's (dataIdAttr option) into an array of string.

    Returns string[]

Static create

  • Creation of new instances.

    Parameters

    • element: HTMLElement

      Any variety of HTMLElement.

    • Optional options: sortablejs.Options

      Sortable options object.

    Returns sortablejs

Static get

  • Get the Sortable instance on an element.

    Parameters

    • element: HTMLElement

    Returns undefined | sortablejs

Static mount

  • mount(...sortablePlugins: SortablePlugin[]): void
  • Mounts a plugin to Sortable

    example

    Sortable.mount(new MultiDrag(), new AutoScroll())

    Parameters

    • Rest ...sortablePlugins: SortablePlugin[]

    Returns void

Generated using TypeDoc