pub struct Options { /* private fields */ }
Expand description
See https://github.com/SortableJS/Sortable for more documentation about available options
Implementations§
Source§impl Options
impl Options
Sourcepub fn new() -> Options
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.
pub fn group(&mut self, value: &str) -> &mut Options
pub fn sort(&mut self, value: bool) -> &mut Options
pub fn delay(&mut self, value: f64) -> &mut Options
pub fn delay_on_touch_only(&mut self, value: bool) -> &mut Options
pub fn touch_start_threshold(&mut self, value: f64) -> &mut Options
pub fn disabled(&mut self, value: bool) -> &mut Options
pub fn animation_ms(&mut self, value: f64) -> &mut Options
pub fn easing(&mut self, value: &str) -> &mut Options
pub fn handle(&mut self, value: &str) -> &mut Options
pub fn filter(&mut self, value: &str) -> &mut Options
pub fn prevent_on_filter(&mut self, value: bool) -> &mut Options
pub fn draggable(&mut self, value: &str) -> &mut Options
pub fn data_id_attr(&mut self, value: &str) -> &mut Options
pub fn ghost_class(&mut self, value: &str) -> &mut Options
pub fn chosen_class(&mut self, value: &str) -> &mut Options
pub fn drag_class(&mut self, value: &str) -> &mut Options
pub fn swap_threshold(&mut self, value: f64) -> &mut Options
pub fn invert_swap(&mut self, value: bool) -> &mut Options
pub fn inverted_swap_threshold(&mut self, value: f64) -> &mut Options
pub fn direction(&mut self, value: &str) -> &mut Options
pub fn force_fallback(&mut self, value: bool) -> &mut Options
pub fn fallback_class(&mut self, value: &str) -> &mut Options
pub fn fallback_on_body(&mut self, value: bool) -> &mut Options
pub fn fallback_tolerance(&mut self, value: f64) -> &mut Options
pub fn dragover_bubble(&mut self, value: bool) -> &mut Options
pub fn remove_clone_on_hide(&mut self, value: bool) -> &mut Options
pub fn empty_insert_threshold(&mut self, value: f64) -> &mut Options
pub fn revert_dom(&mut self, value: bool) -> &mut Options
pub fn on_choose(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_unchoose(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_start(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_end(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_add(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_update(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_sort(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_remove(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_filter(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_clone(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_change(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn on_move( &mut self, cb: impl 'static + FnMut(MoveEvent, Object) -> MoveResponse, ) -> &Options
pub fn revert_on_spill(&mut self, value: bool) -> &mut Options
pub fn remove_on_spill(&mut self, value: bool) -> &mut Options
pub fn on_spill(&mut self, cb: impl 'static + FnMut(Event)) -> &Options
pub fn scroll(&mut self, value: bool) -> &mut Options
pub fn force_autoscroll_fallback(&mut self, value: bool) -> &mut Options
pub fn scroll_sensitivity_px(&mut self, value: f64) -> &mut Options
pub fn scroll_speed_px(&mut self, value: f64) -> &mut Options
pub fn bubble_scroll(&mut self, value: bool) -> &mut Options
Sourcepub fn options(&self) -> &Object
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
.
Sourcepub fn apply(&self, elt: &Element) -> Sortable
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more