Alloy UI

sortable  1.0.1

 
Filters

Class Sortable - extends Base

The class allows you to create a Drag & Drop reordered list.

Constructor

Sortable ( )

Properties

delegate - DD.Delegate

A reference to the DD.Delegate instance.

Properties inherited from Attribute:

Properties inherited from Base:

Configuration Attributes

container - String

A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container.

handles - Array

Drag handles to pass on to the internal DD.Delegate instance.

id - String

The id of this sortable, used to get a reference to this sortable list from another list.

invalid - String

A selector string to test if a list item is invalid and not sortable

moveType - String

How should an item move to another list: insert, swap, move, copy. Default: insert

nodes - String

A selector query to get the children of the "container" to make draggable elements from.

opacity - String

The ocpacity to test the proxy item to when dragging.

opacityNode - String

The node to set opacity on when dragging (dragNode or currentNode). Default: currentNode.

Configuration attributes inherited from Base:

Methods

getSortable

static void getSortable ( node )
Get a sortable instance back from a node reference or a selector string.
Parameters:
node <String|Node> The node instance or selector string to use to find a Sortable instance.

join

void join ( Sortable , String )
Join this Sortable with another Sortable instance.
  • full: Exchange nodes with both lists.
  • inner: Items can go into this list from the joined list.
  • outer: Items can go out of the joined list into this list.
  • none: Removes the join.
Parameters:
Sortable <object> sel The sortable list to join with
String <object> type The type of join to do: full, inner, outer, none. Default: full
Chainable: This method is chainable.

plug

void plug ( Class , Object )
Passthrough to the DD.Delegate.ddplug method
Parameters:
Class <object> cls The class to plug
Object <object> config The class config
Chainable: This method is chainable.

reg

static void reg ( Sortable )
Register a Sortable instance with the singleton to allow lookups later.
Parameters:
Sortable <object> s A Sortable instance.

unreg

static void unreg ( Sortable )
Unregister a Sortable instance with the singleton.
Parameters:
Sortable <object> s A Sortable instance.

Events

containerChange

containerChange ( event )
Fires when the value for the configuration attribute 'container' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

handlesChange

handlesChange ( event )
Fires when the value for the configuration attribute 'handles' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

idChange

idChange ( event )
Fires when the value for the configuration attribute 'id' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

invalidChange

invalidChange ( event )
Fires when the value for the configuration attribute 'invalid' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

moveTypeChange

moveTypeChange ( event )
Fires when the value for the configuration attribute 'moveType' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

nodesChange

nodesChange ( event )
Fires when the value for the configuration attribute 'nodes' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

opacityChange

opacityChange ( event )
Fires when the value for the configuration attribute 'opacity' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

opacityNodeChange

opacityNodeChange ( event )
Fires when the value for the configuration attribute 'opacityNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

Events inherited from Base: