Categories

.selectable()

Categories: UI

.selectable( [ options ] )

Plugin: jQuery.ui.selectable

Description: Apply the Selectable widget for each element in the set of matched elements

  • .selectable( [ options ] )

    version added: 1.0

    options   A map of additional options pass to the widget.

The jQuery UI Selectable plugin allows for elements to be selected by dragging a box (sometimes called a lasso) with the mouse over the elements. Also, elements can be selected by click or drag while holding the Ctrl/Meta key, allowing for multiple (non-contiguous) selections.

  • disabled

    Disables (true) or enables (false) the selectable. Can be set when initialising (first creating) the selectable.

    Default: false

  • autoRefresh

    This determines whether to refresh (recalculate) the position and size of each selectee at the beginning of each select operation. If you have many many items, you may want to set this to false and call the refresh method manually.

    Default: true

  • cancel

    Prevents selecting if you start on elements matching the selector.

    Default: ':input,option'

  • delay

    Time in milliseconds to define when the selecting should start. It helps preventing unwanted selections when clicking on an element.

  • distance

    Tolerance, in pixels, for when selecting should start. If specified, selecting will not start until after mouse is dragged beyond distance.

  • filter

    The matching child elements will be made selectees (able to be selected).

    Default: '*'

  • tolerance

    Possible values: 'touch', 'fit'.

    Default: 'touch'

  • create

    This event is triggered when selectable is created.

  • selected

    This event is triggered at the end of the select operation, on each element added to the selection.

  • selecting

    This event is triggered during the select operation, on each element added to the selection.

  • start

    This event is triggered at the beginning of the select operation.

  • stop

    This event is triggered at the end of the select operation.

  • unselected

    This event is triggered at the end of the select operation, on each element removed from the selection.

  • unselecting

    This event is triggered during the select operation, on each element removed from the selection.

  • destroy

    • .selectable( "destroy" )

      version added: 1.0

    Remove the selectable functionality completely. This will return the element back to its pre-init state.

  • disable

    • .selectable( "disable" )

      version added: 1.0

    Disable the selectable.

  • enable

    • .selectable( "enable" )

      version added: 1.0

    Enable the selectable.

  • option

    • .selectable( "option" , optionName , [value] )

      version added: 1.0

    Get or set any selectable option. If no value is specified, will act as a getter.

  • option

    • .selectable( "option" , options )

      version added: 1.0

    Set multiple selectable options at once by providing an options object.

  • widget

    • .selectable( "widget" )

      version added: 1.0

    Returns the .ui-selectable element.

  • refresh

    • .selectable( "refresh" )

      version added: 1.0

    Refresh the position and size of each selectee element. This method can be used to manually recalculate the position and size of each selectee element. Very useful if autoRefresh is set to false.