Struct Options

Source
pub struct Options { /* private fields */ }
Expand description

See https://github.com/SortableJS/Sortable for more documentation about available options

Implementations§

Source§

impl Options

Source

pub fn new() -> Options

Create a builder for Sortable

This builder allows for configuration options to be set. Once the desired configuration is done, use apply to apply it to a list.

Source

pub fn group(&mut self, value: &str) -> &mut Options

Source

pub fn sort(&mut self, value: bool) -> &mut Options

Source

pub fn delay(&mut self, value: f64) -> &mut Options

Source

pub fn delay_on_touch_only(&mut self, value: bool) -> &mut Options

Source

pub fn touch_start_threshold(&mut self, value: f64) -> &mut Options

Source

pub fn disabled(&mut self, value: bool) -> &mut Options

Source

pub fn animation_ms(&mut self, value: f64) -> &mut Options

Source

pub fn easing(&mut self, value: &str) -> &mut Options

Source

pub fn handle(&mut self, value: &str) -> &mut Options

Source

pub fn filter(&mut self, value: &str) -> &mut Options

Source

pub fn prevent_on_filter(&mut self, value: bool) -> &mut Options

Source

pub fn draggable(&mut self, value: &str) -> &mut Options

Source

pub fn data_id_attr(&mut self, value: &str) -> &mut Options

Source

pub fn ghost_class(&mut self, value: &str) -> &mut Options

Source

pub fn chosen_class(&mut self, value: &str) -> &mut Options

Source

pub fn drag_class(&mut self, value: &str) -> &mut Options

Source

pub fn swap_threshold(&mut self, value: f64) -> &mut Options

Source

pub fn invert_swap(&mut self, value: bool) -> &mut Options

Source

pub fn inverted_swap_threshold(&mut self, value: f64) -> &mut Options

Source

pub fn direction(&mut self, value: &str) -> &mut Options

Source

pub fn force_fallback(&mut self, value: bool) -> &mut Options

Source

pub fn fallback_class(&mut self, value: &str) -> &mut Options

Source

pub fn fallback_on_body(&mut self, value: bool) -> &mut Options

Source

pub fn fallback_tolerance(&mut self, value: f64) -> &mut Options

Source

pub fn dragover_bubble(&mut self, value: bool) -> &mut Options

Source

pub fn remove_clone_on_hide(&mut self, value: bool) -> &mut Options

Source

pub fn empty_insert_threshold(&mut self, value: f64) -> &mut Options

Source

pub fn revert_dom(&mut self, value: bool) -> &mut Options

Source

pub fn on_choose(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_unchoose(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_start(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_end(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_add(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_update(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_sort(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_remove(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_filter(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_clone(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_change(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn on_move( &mut self, cb: impl 'static + FnMut(MoveEvent, Object) -> MoveResponse, ) -> &Options

Source

pub fn revert_on_spill(&mut self, value: bool) -> &mut Options

Source

pub fn remove_on_spill(&mut self, value: bool) -> &mut Options

Source

pub fn on_spill(&mut self, cb: impl 'static + FnMut(Event)) -> &Options

Source

pub fn scroll(&mut self, value: bool) -> &mut Options

Source

pub fn force_autoscroll_fallback(&mut self, value: bool) -> &mut Options

Source

pub fn scroll_sensitivity_px(&mut self, value: f64) -> &mut Options

Source

pub fn scroll_speed_px(&mut self, value: f64) -> &mut Options

Source

pub fn bubble_scroll(&mut self, value: bool) -> &mut Options

Source

pub fn options(&self) -> &Object

Recover the javascript options that are being built in this object

Note that you can set options on this object through js_sys::Reflect. This allows setting options that are not planned for by sortable-js-rs.

Source

pub fn apply(&self, elt: &Element) -> Sortable

Apply the current configuration as a Sortable instance on elt

Do not forget to keep the return value of this function alive for as long as you want the callbacks to be callable, as JS code will error out should an event happen after it was dropped.

Auto Trait Implementations§

§

impl Freeze for Options

§

impl !RefUnwindSafe for Options

§

impl !Send for Options

§

impl !Sync for Options

§

impl Unpin for Options

§

impl !UnwindSafe for Options

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.