Show:

A widget providing sorting capabilities for a list of elements

Methods

_uiHash

() Object private

A dump of the current state of the widget

Returns:

Object:

A ui object holding the current state. The ui object has the properties:

{
  change: 'move'| 'add' | 'remove',
  movement: 'drag' | 'moveUp' | 'moveTop' | 'moveDown' | 'moveLast'
}

add

(
  • items
)
Object

Add the given items to the orderingList

Parameters:

  • items Object

    the items to add

Returns:

Object:

the items added to the orderingList

connectWith

(
  • target
)
chainable

Connect the orderingList with another orderingList, allowing items to be dragged between them.

Parameters:

  • target Object

    The orderingList with which to connect.

destroy

()

Removes the ordering list functionality completely. This will return the element back to its pre-init state.

getOrderedElements

() Object

Retrieve the jQuery list of all items in the orderingList

Returns:

Object:

the jQuery list of selected elements

getOrderedKeys

() Array

Retrieve the keys of all items in the orderingList

Returns:

Array:

An array of the keys of the selected elements

getSelected

() Object

Find and return the list of oerderingList elements that are selected

Returns:

Object:

A jQuery list of selected items

isSelected

(
  • item
)
Boolean

Determine if the given item is selected

Parameters:

  • item Object

    jQuery object of one of the orderingList elements

Returns:

Boolean:

True if the item is selected, false otherwise

moveDown

(
  • items
  • [event=null]
)
chainable

Move the given items down one step in the orderingList

Parameters:

  • items Object

    the items to move down

  • [event=null] Object optional

    the event used that triggered this movement

moveLast

(
  • items
  • [event=null]
)
chainable

Move the given items to the end of the orderingList

Parameters:

  • items Object

    the items to move to the end

  • [event=null] Object optional

    the event used that triggered this movement

moveTop

(
  • items
  • [event=null]
)
chainable

Move the given items to the top of the orderingList

Parameters:

  • items Object

    the items to move to the top

  • [event=null] Object optional

    the event used that triggered this movement

moveUp

(
  • items
  • [event=null]
)
chainable

Move the given items up one step in the orderingList

Parameters:

  • items Object

    the items to move up

  • [event=null] Object optional

    the event used that triggered this movement

remove

(
  • items
)
Object

Remove the given items from the orderingList

Parameters:

  • items Object

    the items to remove

Returns:

Object:

the items removed from the orderingList

selectItem

(
  • item
)
chainable

Select the given item

Parameters:

  • item Object

    jQuery object of the orderingList element to select

unSelectAll

() chainable

Un-select all items in the orderingList

unSelectItem

(
  • item
)
chainable

Un-select the given item

Parameters:

  • item Object

    jQuery object of the orderingList element to un-select

Properties

buttonsText

JSON

Text to be applied to the ordering buttons of the ordering list. The text should be arranged as an object in JSON notation.

eg. {first: ..., up: ..., down: ..., last: ...}

Default: null

columnClasses

String

When table layout is used, columnClasses specifies a comma-delimited list of CSS style classes to apply to each column. A space separated list of classes may be specified for an individual column.

If the number of classes in this list is less than the number of column children, then no class will be applied to the columns greater than the number of classes. If however the final class in the list is the * character, the classes will instead be applied in a repeating manner every n-fold column, where n is the order the class in this list.

If there are more class names than columns, the overflow ones are ignored.

contained

Boolean

When true, it is not possible to move a selected element outside of the orderingList

Default: true

disabled

Boolean

Disable the orderingList widget

Default: false

dragSelect

Boolean

When true dragging the mouse over the elements selects multiple elements. This also reduces the drag handle used to re-order the elements.

Default: true

dropOnEmpty

Boolean

Allows elements to be dragged onto an empty list when true

Default: true

header

String

The text to use for the orderingList header

height

String

The height of the orderingList

  1. A String with appropriate units, eg.:

    height: '120px'
  2. An integer without any units, in which case the units of px are assumed.

    height: 120

heightMax

String

The maximum height of the orderingList

  1. A String with appropriate units, eg.:

    heightMax: '120px'
  2. An integer without any units, in which case the units of px are assumed:

    heightMax: 120

heightMin

String

The minimum height of the orderingList

  1. A String with appropriate units, eg.:

    heightMin: '120px'
  2. An integer without any units, in which case the units of px are assumed:

    heightMin: 120

mouseOrderable

Boolean

Allows elements to be ordered by drag and drop with the mouse when true

Default: true

showButtons

Boolean

When true, show the buttons for ordering the selected elements

Default: true

sortFunction

Function

Function used to sort the elements after an item has been added to the list. sortFunction must meet the API requirements of the compareFunction for the Array.prototype.sort method.

styleClass

String

A CSS class to be added to the orderingList. Multiple classes should be space separated

Events

addDomElements

Fired after the dynamically created DOM elements of the orderingList have been created

blur

Fired when the orderingList loses focus

change

Fired when the target list of the orderingList changes values.

create

Fired after the orderingList has been created

destroy

Fired after the orderingList has been destroyed

focus

Fired when the orderingList receives focus