Name | Type | Default | ||||||
---|---|---|---|---|---|---|---|---|
appendTo | String | 'parent' | ||||||
Defines where the helper that moves with the mouse is being appended to during the drag (for example, to resolve overlap/zIndex issues). Code examples
Set the
Get the
|
||||||||
axis | String/Number | null | ||||||
If defined, the items can be dragged only horizontally or vertically. Possible Values:
Code examples
Set the
Get the
Try it: axis is set to 'y'
|
||||||||
cancel | String | 'input,textarea,button,select,option' | ||||||
Prevents sorting if you start on elements matching the selector. Code examples
Set the
Get the
|
||||||||
connectWith | String/Boolean | true | ||||||
A selector of other sortable elements that the items from this list should be connected to. Code examples
Set the
Get the
|
||||||||
containment | String/Boolean | false | ||||||
Defines a bounding box that the sortable items are constrained to while dragging. Code example
Set the
Get the
|
||||||||
cursor | String | 'auto' | ||||||
Defines the cursor that is being shown while sorting. Code examples
Set the
Get the
Try it: cursor is set to 'move'
|
||||||||
cursorAt | Object | false | ||||||
Moves the sorting element or helper so the cursor always appears to drag from the same position. Coordinates can be given as a hash using a combination of one or two keys: { top, left, right, bottom }. Code examples
Set the
Get the
|
||||||||
delay | Number | 0 | ||||||
Time in milliseconds to define when the sorting should start. Adding a delay helps preventing unwanted drags when clicking on an element. Code examples
Set the
Get the
Try it: delay is set to 500
|
||||||||
disabled | Boolean | false | ||||||
Disables the widget if set to true. Code example
Set the
Get the
Try it: disabled is set to true
|
||||||||
distance | Number | 1 | ||||||
Tolerance, in pixels, for when sorting should start. If specified, sorting will not start until after mouse is dragged beyond distance. Can be used to allow for clicks on elements within a handle. Code examples
Set the
Get the
Try it: distance is set to 10
|
||||||||
dropOnEmpty | Boolean | true | ||||||
If false, items from this sortable can't be dropped on an empty connect sortable. Code example
Set the
Get the
Try it: dropOnEmpty is set to false
|
||||||||
forceHelperSize | Boolean | false | ||||||
If true, forces the helper to have a size. Code examples
Set the
Get the
Try it: forceHelperSize is set to true
|
||||||||
forcePlaceholderSize | Boolean | false | ||||||
Sets or gets the displaying of the popover's arrow. Code examples
Set the
Get the
|
||||||||
grid | Array | false | ||||||
Snaps the sorting element or helper to a grid, every x and y pixels. Code examples
Set the
Get the
Try it: grid is set to [ 50, 50 ]
|
||||||||
handle | String/Boolean | false | ||||||
Restricts sort start click to the specified element. Code examples
Set the
Get the
Try it: handle is set to '.handle'
|
||||||||
helper | String/Function | 'original' | ||||||
Allows for a helper element to be used for dragging display. Code examples
Set the
Get the
Try it: helper is set to 'clone'
|
||||||||
items | String | '> *' | ||||||
Specifies which items inside the element should be sortable. Code examples
Set the
Get the
|
||||||||
opacity | Number/Boolean | false | ||||||
Defines the opacity of the helper while sorting. From 0.01 to 1. Code examples
Set the
Get the
Try it: opacity is set to 0.5
|
||||||||
placeholderShow | String/Boolean | "original" | ||||||
A class name that gets applied to the otherwise white space. Code examples
Set the
Get the
|
||||||||
revert | Boolean/Number | false | ||||||
Whether the sortable items should revert to their new positions using a smooth animation. Code examples
Set the
Get the
Try it: revert is set to true
|
||||||||
scroll | Boolean | true | ||||||
If set to true, the page scrolls when coming to an edge. Code examples
Set the
Get the
Try it: scroll is set to false
|
||||||||
scrollSensitivity | Number | 20 | ||||||
Defines how near the mouse must be to an edge to start scrolling. Code examples
Set the
Get the
Try it: scrollSensitivity is set to 10
|
||||||||
scrollSpeed | Number | 20 | ||||||
Allows for a helper element to be used for dragging display. Code examples
Set the
Get the
Try it: scrollSpeed is set to 40
|
||||||||
tolerance | String/Function | 'intersect' | ||||||
Specifies which mode to use for testing whether the item being moved is hovering over another item. Code examples
Set the
Get the
Try it: tolerance is set to 'pointer'
|
||||||||
zIndex | Number | 1000 | ||||||
Allows for a helper element to be used for dragging display. Code examples
Set the
Get the
Try it: zIndex is set to 9999
|
||||||||
Events |
||||||||
activate | Event | |||||||
This event is triggered on drag start when are used connected lists. Code examples
Bind to the
|
||||||||
beforeStop | Event | |||||||
This event is triggered when sorting stops, but when the placeholder/helper is still available. Code examples
Bind to the
|
||||||||
change | Event | |||||||
This event is triggered when the DOM position of an item is changed. Code examples
Bind to the
|
||||||||
create | Event | |||||||
This event is triggered when the sortable is created. Code examples
Bind to the
|
||||||||
deactivate | Event | |||||||
This event is triggered when sorting was stopped, is propagated to all possible connected lists. Code examples
Bind to the
|
||||||||
out | Event | |||||||
This event is triggered when a sortable item is moved away from a sortable list. Code examples
Bind to the
|
||||||||
over | Event | |||||||
This event is triggered when a sortable item is moved into a sortable list. Code examples
Bind to the
|
||||||||
receive | Event | |||||||
This event is triggered when an item from a connected sortable list has been dropped into another list. Code examples
Bind to the
|
||||||||
remove | Event | |||||||
This event is triggered when a sortable item from the list has been dropped into another. Code examples
Bind to the
|
||||||||
sort | Event | |||||||
This event is triggered during sorting. Code examples
Bind to the
|
||||||||
start | Event | |||||||
This event is triggered when sorting starts. Code examples
Bind to the
|
||||||||
stop | Event | |||||||
This event is triggered when sorting has stopped. Code examples
Bind to the
|
||||||||
update | Event | |||||||
This event is triggered when the user stopped sorting and the DOM position has changed. Code examples
Bind to the
|
||||||||
Methods |
||||||||
cancel | Method | |||||||
Cancels a change in the current sortable and reverts it to the state prior to when the current sort was started.
None Code examples
Invoke the
Try it: cancel the changes
|
||||||||
destroy | Method | |||||||
Removes the sortable functionality.
None Code examples
Invoke the
Try it: destroy the widget
|
||||||||
disable | Method | |||||||
Disables the widget.
None Code examples
Invoke the
Try it: disable the widget
|
||||||||
enable | Method | |||||||
Enable the widget.
None Code examples
Invoke the
Try it: enable the widget
|
||||||||
refresh | Method | |||||||
Refresh the items.
None Code examples
Invoke the
Try it: refresh the items
|
||||||||
refreshPositions | Method | |||||||
Refresh the cached positions of the sortable items.
None Code examples
Invoke the
|
||||||||
serialize | Method | |||||||
Serializes the jqxSortable item ids into a form/ajax submittable string. Calling this method produces a hash that can be appended to any url to easily submit a new item order back to the server.
None Code examples
Invoke the
Try it: serialize the items
|
||||||||
toArray | Method | |||||||
Serializes the jqxSortable item ids into an array of strings.
None Code examples
Invoke the
Try it: serialize the id's
|