new ListDragon(selectorOrModelLists, optionsopt, cssStylesheetReferenceElementopt)
This object services a set of item lists that allow dragging and dropping items within and between lists in a set.
Two strategies are supported:
- Supply your own HTML markup and let the API build the item models for you.
To use this strategy, script your HTML and provide one of these:
- an array of all the list item (
<li>
) tags - a CSS selector that points to all the list item tags
- an array of all the list item (
- Supply your own item models and let the API build the HTML markup for you. To use this strategy, provide an array of model lists.
The new ListDragon object's modelLists
property references the array of model lists the API constructed for you in strategy #1 or the array of model lists you supplied for strategy #2.
After the user performs a successful drag-and-drop operation, the position of the model references within the modelLists
array is rearranged. (The models themselves are the original objects as supplied in the model lists; they are not rebuilt or altered in any way. Just the references to them are moved around.)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selectorOrModelLists |
string | Array.<Element> | Array.<modelListType> | You must supply one of the items in bold below:
In either case (2.1 or 2.2), each element of such arrays of item models may take the form of:
Regarding these string primitives, each is either:
|
||
options |
object |
<optional> |
{} | You may supply "global" template variables here, representing the "outer scope," after first searching each model and then each model list. |
cssStylesheetReferenceElement |
undefined | null | Element | string |
<optional> |
Determines where to insert the stylesheet. (This is the only formal option.) Passed to css-injector, the overloads are (from css-injector docs):
|