Methods
attachToList

Attaches Lithium List to a list. See the set up page for a discussion of the required HTML and CSS. Each attachment creates its own instance.

lithiumlist.attachToList(key, outerCont, listCont, listItemClass [, props])
key
Type: String
Your Lithium List licence key.
outerCont
Type: Element
The outerCont element to which the Lithium List instance will be attached. Must be a DOM element or window (and if it is to be window, note window as outerCont). Must not be document or document.body.
listCont
Type: Element
The listCont element to which the Lithium List instance will be attached.
listItemClass
Type: String
The class name of the list item elements.
props
Type: Object
If provided, overrides the default settings for this instance. May contain only the settings to be overridden. Others will inherit their default values.
EXAMPLE JS
lithiumlist.attachToList(
    '0123456789',
    document.getElementById('outer-cont'),
    document.getElementById('list-cont'),
    'list-item',
    {
        sortDragHandleClass: 'drag-handle'
    }
);
detachFromList

Detaches Lithium List from a list.

lithiumlist.detachFromList(listCont)
listCont
Type: Element
A listCont element to which Lithium List is attached.
EXAMPLE JS
lithiumlist.detachFromList(
    document.getElementById('list-cont')
);
setListProperties

Changes the settings for a Lithium List instance.

lithiumlist.setListProperties(listCont, props)
listCont
Type: Element
A listCont element to which Lithium List is attached.
props
Type: Object
The settings to be changed, and their new values.
EXAMPLE JS
lithiumlist.setListProperties(
    document.getElementById('list-cont'),
    {
        sortDragHandleClass: 'new-drag-handle'
    }
);
setDefaultProperties

Changes the default settings for all Lithium List instances created after the change.

lithiumlist.setDefaultProperties(props)
props
Type: Object
The default settings to be changed, and their new values.
EXAMPLE JS
lithiumlist.setDefaultProperties(
    {
        sortDragHandleClass: 'new-default-drag-handle'
    }
);
triggerLeft

Triggers a full left slide of a list item. Has no effect (and displays a console warning) if leftEnabled: false for the Lithium List instance.

lithiumlist.triggerLeft(listCont, index)
listCont
Type: Element
A listCont element to which Lithium List is attached.
index
Type: Integer
The index of the list item to slide left.
EXAMPLE JS
lithiumlist.triggerLeft(
    {
        document.getElementById('list-cont'),
        5
    }
);
triggerRight

Triggers a full right slide of a list item. Has no effect (and displays a console warning) if rightEnabled: false for the Lithium List instance.

lithiumlist.triggerRight(listCont, index)
listCont
Type: Element
A listCont element to which Lithium List is attached.
index
Type: Integer
The index of the list item to slide right.
EXAMPLE JS
lithiumlist.triggerRight(
    {
        document.getElementById('list-cont'),
        5
    }
);