Appendix K. Sortables
Method | Description | Return Value |
---|---|---|
Sortable Methods | ||
| Makes the selected element(s) sortable. Options can be specified by passing an object literal as the first argument using key, value pairs. For a complete list of options, see the "Sortable Options" section later in this Appendix. | jQuery |
| Disables sortable functionality on the selected element(s). | jQuery |
| Enables sortable functionality on the selected element(s). | jQuery |
| Completely removes sortable functionality from the selected element(s). | jQuery |
| 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 |
| Refreshes the sortable items. | jQuery |
| Refreshes the cached positions of sortable items. | jQuery |
Sortable Options
Option | Description | Type |
---|---|---|
| Defaults to the parent; defines where the helper that moves with the mouse is being appended to during the drag (e.g., to resolve overlap/zIndex issues). | String |
| If specified, the items can only be dragged along either the X- or Y-axis. Only allows the values x or y. | One of x or y |
| Prevents sorting from beginning on elements that match the selector. | Selector |
| Accepts an array of selectors, where the selector(s) match elements that are sortable elements. If this option is specified, ... |
Get Beginning JavaScript® and CSS Development with jQuery now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.