Struct dioxus_sortable::UseSorterBuilder
source · pub struct UseSorterBuilder<F> { /* private fields */ }Expand description
Builder for UseSorter. Use this to specify the field and direction of the sorter. For example by passing sort state from URL parameters.
Ordering of Self::with_field and Self::with_direction matters as the builder will ignore invalid combinations specified by the field’s Sortable. This is to prevent the user from specifying a direction that is not allowed by the field.
Implementations§
source§impl<F: Copy + Default + Sortable> UseSorterBuilder<F>
impl<F: Copy + Default + Sortable> UseSorterBuilder<F>
sourcepub fn with_field(&self, field: F) -> Self
pub fn with_field(&self, field: F) -> Self
Optionally sets the initial field to sort by.
sourcepub fn with_direction(&self, direction: Direction) -> Self
pub fn with_direction(&self, direction: Direction) -> Self
Optionally sets the initial direction to sort by.Direction::Ascending can be set.
sourcepub fn use_sorter(self, cx: &ScopeState) -> UseSorter<'_, F>
pub fn use_sorter(self, cx: &ScopeState) -> UseSorter<'_, F>
Creates Dioxus hooks to manage state. Must follow Dioxus hook rules and be called unconditionally in the same order as other hooks. See use_sorter() for simple usage.
This fn (or Self::use_sorter) must be called or never used. See the docs on UseSorter::sort on using conditions.
If the field or direction has not been set then the default values will be used.
Trait Implementations§
source§impl<F: Clone> Clone for UseSorterBuilder<F>
impl<F: Clone> Clone for UseSorterBuilder<F>
source§fn clone(&self) -> UseSorterBuilder<F>
fn clone(&self) -> UseSorterBuilder<F>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<F: Debug> Debug for UseSorterBuilder<F>
impl<F: Debug> Debug for UseSorterBuilder<F>
source§impl<F: PartialEq> PartialEq<UseSorterBuilder<F>> for UseSorterBuilder<F>
impl<F: PartialEq> PartialEq<UseSorterBuilder<F>> for UseSorterBuilder<F>
source§fn eq(&self, other: &UseSorterBuilder<F>) -> bool
fn eq(&self, other: &UseSorterBuilder<F>) -> bool
self and other values to be equal, and is used
by ==.