(^562) ❘ APPENDIX K SORTABLE
sortable('option',
object)
Sets the specifi ed options to the specifi ed
values by providing an object representing
all of the options you’d like to set.
jQuery
sortable('refresh') Refreshes the sortable items. jQuery
sortable
('refreshPositions')
Refreshes the cached positions of sortable
items.
jQuery
sortable
('serialize',
options)
Returns a string of serialized IDs for each
sortable item, which can then be used in an
AJAX request or input form. For a complete
list of options, see the “Serialize Options”
section later in this appendix.
String
sortable('toArray',
options)
Serializes all the sortable items’ element id
properties into an array.
An object of options can be provided in the
second argument; the only option that can
be customized is changing which attribute is
used.
{
attribute : 'data-custom'
}
Array
sortable('widget') Returns a jQuery object that contains the
sortable element.
jQuery
SORTABLE OPTIONS
OPTION DESCRIPTION TYPE
appendTo Defaults to the parent; defi nes where the
helper that moves with the mouse is being
appended to during the drag (for example,
to resolve overlap/zIndex issues).
Default value: 'parent'
jQuery
Element
Selector
String
axis If specifi ed, the items can be dragged only
along either the X- or Y-axis. Only allows the
values 'x' or 'y'.
Default value: false
String
Boolean
cancel Prevents sorting from the beginning on ele-
ments that match the selector.
Default selector: "input, textarea,
button, select, option"
Selector
(continued)
http://www.it-ebooks.info
elliott
(Elliott)
#1